Overview Tutorial API reference Examples Build Download ZmqMessage 0.1 - 21 Oct 2011

include/zmqmessage/Config.hpp File Reference

Basic compile time configurations for ZmqMessage library. More...

#include "zmq.hpp"
#include <string>
#include <stdexcept>

Go to the source code of this file.

Namespaces

namespace  ZmqMessage

Classes

class  ZmqMessage::DefaultExceptionTemplate< Tag >

Defines

#define ZMQMESSAGE_STRING_CLASS   std::string
#define ZMQMESSAGE_LOG_STREAM_NONE   if(1); else std::cerr
#define ZMQMESSAGE_LOG_TERM   std::endl
#define ZMQMESSAGE_EXCEPTION_MACRO(name)
#define ZMQMESSAGE_WRAP_ZMQ_ERROR   1

Typedefs

typedef zmq::error_t ZmqMessage::ZmqErrorType

Functions

void ZmqMessage::throw_zmq_error (const char *err)


Detailed Description

Basic compile time configurations for ZmqMessage library.

Copyright (c) 2010-2011 Phorm, Inc. GNU LGPL v 3.0, see http://www.gnu.org/licenses/lgpl-3.0-standalone.html

Author:
Andrey Skryabin <andrew@zmqmessage.org>, et al.

Define Documentation

#define ZMQMESSAGE_EXCEPTION_MACRO ( name   ) 

Value:

class name##_tag {}; \
  typedef ::ZmqMessage::DefaultExceptionTemplate<name##_tag> name
Macro to generate exception class definition by exception name. It enables you to adapt ZmqMessage to you application exception policy (and hierarchy). By default, we generate simple derivative from std::logic_error. Note, that final semicolon (';') will be appended at end where macro is used, so it's not needed in macro definition. Note, that this constant is overridable either for application builds without shared library or during compiling shared library.

#define ZMQMESSAGE_LOG_STREAM_NONE   if(1); else std::cerr

Use this constant to disable logging completely.

 #define ZMQMESSAGE_LOG_STREAM ZMQMESSAGE_LOG_STREAM_NONE

#define ZMQMESSAGE_LOG_TERM   std::endl

Streamable literal that is appended (<<) to every log record. If your logging system doesn-t require terminal (such as new line) you can

 #define ZMQMESSAGE_LOG_TERM ""
Note, that this constant is overridable either for application builds without shared library or during compiling shared library. Defining this setting in your application headers during building with shared library takes no effect.

#define ZMQMESSAGE_STRING_CLASS   std::string

Class that is default string representation. Must satisfy the requirements of the string concept. String concept requires a class to be both constructible on const char* and size_t and have data() and length() accessor methods:

 class MyString
 {
  MyString(const char*, size_t);
  const char* data() const;
  size_t length() const;
 };
It's possible (and desirable) for it not to copy and own the memory, but just wrap the external memory region. For example, take a look at StringFace class from examples. By default, std::string is used. You may define this setting both if you are linking against shared library or using library as built-in (see linking options)

#define ZMQMESSAGE_WRAP_ZMQ_ERROR   1

if defined, zmq::error_t will be wrapped with exception generated according to ZMQMESSAGE_EXCEPTION_MACRO and named ZmqException. Otherwise, it's thrown upwards as is. For non header-only builds must be the same in shared library and client code, just like ZMQMESSAGE_EXCEPTION_MACRO


ZmqMessage 0.1 — open source software, support@zmqmessage.org