void fatalFudgeError ( FudgeStatus status, const char * context ) { fprintf ( stderr, "FATAL ERROR: %s : %s\n", context, FudgeStatus_strerror ( status ) ); exit ( 1 ); }
/// Creates a binary encoding of a Fudge message. /// /// @param[in] msg the message to encode /// @param[out] pcbData receives the length of the allocated encoding /// @return the encoded form static void *_EncodeFudgeMsg (FudgeMsg msg, size_t *pcbData) { FudgeStatus status; FudgeMsgEnvelope env; void *pData; if ((status = FudgeMsgEnvelope_create (&env, 0, 0, 0, msg)) != FUDGE_OK) { LOGWARN ("Couldn't create message envelope, error " << FudgeStatus_strerror (status)); return NULL; } fudge_i32 cbData; status = FudgeCodec_encodeMsg (env, (fudge_byte**)&pData, &cbData); FudgeMsgEnvelope_release (env); if (status != FUDGE_OK) { LOGWARN ("Couldn't encode Fudge message, error " << FudgeStatus_strerror (status)); return NULL; } *pcbData = cbData; return pData; }
const char * exception::what ( ) const throw ( ) { return FudgeStatus_strerror ( m_status ); }
exception::exception ( FudgeStatus status ) : std::runtime_error ( FudgeStatus_strerror ( status ) ) , m_status ( status ) { }