mosesdecoder/util/exception.hh File Reference

#include <exception>
#include <limits>
#include <sstream>
#include <string>
#include <stdint.h>

Go to the source code of this file.

Classes

class  util::Exception
struct  util::Exception::ExceptionTag< T >
class  util::ErrnoException
class  util::OverflowException

Namespaces

namespace  util

Defines

#define UTIL_FUNC_NAME   NULL
#define UTIL_THROW_BACKEND(Condition, Exception, Arg, Modify)
#define UTIL_THROW_ARG(Exception, Arg, Modify)   UTIL_THROW_BACKEND(NULL, Exception, Arg, Modify)
#define UTIL_THROW(Exception, Modify)   UTIL_THROW_BACKEND(NULL, Exception, , Modify);
#define UTIL_UNLIKELY(x)   (x)
#define UTIL_THROW_IF_ARG(Condition, Exception, Arg, Modify)
#define UTIL_THROW_IF(Condition, Exception, Modify)   UTIL_THROW_IF_ARG(Condition, Exception, , Modify)

Functions

template<class Except , class Data >
Except::template ExceptionTag
< Except & >::Identity 
util::operator<< (Except &e, const Data &data)
template<unsigned len>
std::size_t util::CheckOverflowInternal (uint64_t value)
template<>
std::size_t util::CheckOverflowInternal< 8 > (uint64_t value)
std::size_t util::CheckOverflow (uint64_t value)


Define Documentation

#define UTIL_FUNC_NAME   NULL

Definition at line 61 of file exception.hh.

#define UTIL_THROW ( Exception,
Modify   )     UTIL_THROW_BACKEND(NULL, Exception, , Modify);

#define UTIL_THROW_ARG ( Exception,
Arg,
Modify   )     UTIL_THROW_BACKEND(NULL, Exception, Arg, Modify)

Definition at line 80 of file exception.hh.

Referenced by util::PReadOrThrow().

#define UTIL_THROW_BACKEND ( Condition,
Exception,
Arg,
Modify   ) 

Value:

do { \
  Exception UTIL_e Arg; \
  UTIL_e.SetLocation(__FILE__, __LINE__, UTIL_FUNC_NAME, #Exception, Condition); \
  UTIL_e << Modify; \
  throw UTIL_e; \
} while (0)

Definition at line 73 of file exception.hh.

#define UTIL_THROW_IF ( Condition,
Exception,
Modify   )     UTIL_THROW_IF_ARG(Condition, Exception, , Modify)

Definition at line 98 of file exception.hh.

Referenced by Moses::BackwardLanguageModel< Model >::CalcScore(), util::stream::Chain::Chain(), util::ProbingHashTable< ProbEntry, util::IdentityHash >::CheckConsistency(), util::CheckOverflowInternal(), MosesTraining::ScoreFeatureManager::configure(), Moses::Word::CreateFromString(), util::CreateOrThrow(), Moses::BackwardLanguageModel< Model >::Evaluate(), util::ProbingHashTable< ProbEntry, util::IdentityHash >::FindOrInsert(), GrabOrDie(), util::stream::Link::Init(), lm::ngram::trie::RecordReader::Init(), util::ProbingHashTable< ProbEntry, util::IdentityHash >::Insert(), lm::ngram::detail::IsBinaryFormat(), lm::builder::JointOrder(), Moses::RuleTableLoaderStandard::Load(), Moses::GenerationDictionary::Load(), Moses::WordTranslationFeature::Load(), Moses::TargetWordInsertionFeature::Load(), Moses::TargetBigramFeature::Load(), Moses::SourceWordDeletionFeature::Load(), Moses::PhrasePairFeature::Load(), lm::ngram::ProbingVocabulary::LoadedBinary(), lm::ngram::LowerRestBuild< Model >::LowerRestBuild(), util::MakeTemp(), util::MapOrThrow(), lm::ngram::detail::MatchCheck(), util::mkstemp_and_unlink(), util::OpenReadOrThrow(), lm::ngram::trie::RecordReader::operator++(), Moses::Manager::OutputSearchGraphAsHypergraph(), lm::ngram::trie::RecordReader::Overwrite(), Moses::FeatureFunction::ParseLine(), lm::builder::Pipeline(), util::PReadOrThrow(), lm::ReadARPACounts(), lm::ReadBackoff(), util::ReadOrThrow(), util::stream::LineInput::Run(), util::stream::PRead::Run(), util::stream::Read::Run(), lm::builder::CorpusCount::Run(), Moses::TargetPhrase::SetAlignmentInfo(), util::stream::Sort< Compare >::Sort(), split_line(), util::SyncOrThrow(), ThrowingFwrite(), util::UnmapOrThrow(), and util::WriteOrThrow().

#define UTIL_THROW_IF_ARG ( Condition,
Exception,
Arg,
Modify   ) 

Value:

do { \
  if (UTIL_UNLIKELY(Condition)) { \
    UTIL_THROW_BACKEND(#Condition, Exception, Arg, Modify); \
  } \
} while (0)

Definition at line 92 of file exception.hh.

Referenced by util::DupOrThrow(), util::FDOpenOrThrow(), util::FDOpenReadOrThrow(), util::FSyncOrThrow(), util::PartialRead(), util::ResizeOrThrow(), util::SizeOrThrow(), and util::WriteOrThrow().

#define UTIL_UNLIKELY (  )     (x)

Definition at line 89 of file exception.hh.


Generated on Wed Jul 30 00:30:44 2014 for Moses by  doxygen 1.5.9