Skip to content

Commit

Permalink
Merge pull request #122 from xaqq/doxygen
Browse files Browse the repository at this point in the history
Documentation improvement + switch to 4.1.2
  • Loading branch information
hintjens committed Jun 17, 2015
2 parents 1b2ebef + b7cb846 commit 4784589
Show file tree
Hide file tree
Showing 14 changed files with 185 additions and 124 deletions.
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Development
===========



Version 4.1.2
=============

* Fix a compilation bug (#119)
* Improve documentation

Version 4.1.1
=============

Expand Down
4 changes: 2 additions & 2 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ PROJECT_NAME = zmqpp
# This could be handy for archiving the generated documentation or
# if some version control system is used.

PROJECT_NUMBER = 4.1.1
PROJECT_NUMBER = 4.1.2

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
# a quick idea about the purpose of the project. Keep the description short.

PROJECT_BRIEF = "C++ bindings for 0mq"
PROJECT_BRIEF = "C++ bindings for 0mq (libzmq)"

# With the PROJECT_LOGO tag one can specify an logo or icon that is
# included in the documentation. The maximum height of the logo should not
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ AR = ar
LIBRARY_NAME = zmqpp
VERSION_MAJOR = 4
VERSION_MINOR = 1
VERSION_REVISION = 1
VERSION_REVISION = 2

#
# Paths
Expand Down
43 changes: 43 additions & 0 deletions src/mainpage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@mainpage

Introduction
------------

zmqpp is a "high-level" C++ binding for 0mq/zmq. The "high-level" term is used in
comparison to [cppzmq](https://github.com/zeromq/cppzmq) which is somewhat a raw wrapper
around the [libzmq](https://github.com/zeromq/libzmq) C interface.

The library is documented and has a nice test suite. This doesn't mean that the library is bug
free or that the test suite is 100% complete.

The development takes places in this [GitHub repository](http://github.com/zeromq/zmqpp).


Features
---------

Basic features:

+ zmqpp provides most feature from libzmq in a C++ style API.
+ It supports multiple version of [libzmq](https://github.com/zeromq/libzmq).

Being built on top of libzmq, and being a higher-level binding, zmqpp provides some
additional features:

+ [Reactor](@ref zmqpp::reactor) pattern.
+ [Actor](@ref zmqpp::actor) pattern.
+ Support for ZAP.


Examples
--------

zmqpp comes a few examples. These can be found [here](https://github.com/zeromq/zmqpp/tree/develop/examples).

Reading the documentation is a good way to start learning about zmqpp.
The most important classes that you will likely use are thoses:

+ [Context](@ref zmqpp::context).
+ [Socket](@ref zmqpp::socket).
+ [Message](@ref zmqpp::message).
+ And either a [Poller](@ref zmqpp::poller) or a [Reactor](@ref zmqpp::reactor).
30 changes: 15 additions & 15 deletions src/zmqpp/auth.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
namespace zmqpp
{

/*!
/**
* auth - authentication for ZeroMQ security mechanisms
*
* An auth actor takes over authentication for all incoming connections in
Expand All @@ -46,21 +46,21 @@ namespace zmqpp
class auth
{
public:
/*!
/**
* Constructor. A auth actor takes over authentication for all incoming connections in
* its context. You can whitelist or blacklist peers based on IP address,
* and define policies for securing PLAIN, CURVE, and GSSAPI connections.
*
*/
auth(context& ctx);

/*!
/**
* Destructor.
*
*/
~auth();

/*!
/**
* Allow (whitelist) a single IP address. For NULL, all clients from this
* address will be accepted. For PLAIN and CURVE, they will be allowed to
* continue with authentication. You can call this method multiple times
Expand All @@ -70,7 +70,7 @@ class auth
*/
void allow(const std::string &address);

/*!
/**
* Deny (blacklist) a single IP address. For all security mechanisms, this
* rejects the connection without any further authentication. Use either a
* whitelist, or a blacklist, not not both. If you define both a whitelist
Expand All @@ -79,68 +79,68 @@ class auth
*/
void deny(const std::string &address);

/*!
/**
* Configure a ZAP domain. To cover all domains, use "*".
*/
void configure_domain(const std::string &domain);

/*!
/**
* Configure PLAIN authentication. PLAIN authentication uses a plain-text
* username and password.
*
*/
void configure_plain(const std::string &username, const std::string &password);

/*!
/**
* Configure CURVE authentication. CURVE authentication uses client public keys.
* This method can be called multiple times. To cover all domains, use "*".
* To allow all client keys without checking, specify CURVE_ALLOW_ANY for the client_public_key.
*
*/
void configure_curve(const std::string &client_public_key);

/*!
/**
* Configure GSSAPI authentication. GSSAPI authentication uses an underlying
* mechanism (usually Kerberos) to establish a secure context and perform mutual
* authentication.
*
*/
void configure_gssapi();

/*!
/**
* Enable verbose tracing of commands and activity.
*
*/
void set_verbose(bool verbose);

private:
/*!
/**
* Handle an authentication command from calling application.
*
*/
void handle_command(socket& pipe);

/*!
/**
* Handle a PLAIN authentication request from libzmq core
*
* @param user_id store the user as the User-Id.
*/
bool authenticate_plain(zap_request& request, std::string &user_id);

/*!
/**
* Handle a CURVE authentication request from libzmq core
*
* @param user_id store the public key (z85 encoded) as the User-Id.
*/
bool authenticate_curve(zap_request& request, std::string &user_id);

/*!
/**
* Handle a GSSAPI authentication request from libzmq core
*
*/
bool authenticate_gssapi(zap_request& request);

/*!
/**
* Authentication.
*
*/
Expand Down
22 changes: 11 additions & 11 deletions src/zmqpp/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
namespace zmqpp
{

/*!
/**
* The context class represents internal zmq context and io threads.
*
* By default the context class will create one thread, however this can be
Expand All @@ -48,7 +48,7 @@ class context
public:

#if (ZMQ_VERSION_MAJOR < 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR < 2))
/*!
/**
* Initialise the 0mq context.
*
* If only inproc is used then the context may be created with zero threads.
Expand All @@ -62,7 +62,7 @@ class context
*/
context(int const& threads = 1)
#else
/*!
/**
* Initialise the 0mq context.
*
* The context is thread safe an may be used anywhere in your application,
Expand All @@ -85,7 +85,7 @@ class context
}
}

/*!
/**
* Closes the 0mq context.
*
* Any blocking calls other than a socket close will return with an error.
Expand All @@ -101,7 +101,7 @@ class context
}
}

/*!
/**
* Move supporting constructor.
*
* Allows zero-copy move semantics to be used with this class.
Expand All @@ -114,7 +114,7 @@ class context
source._context = nullptr;
}

/*!
/**
* Move supporting operator.
*
* Allows zero-copy move semantics to be used with this class.
Expand All @@ -127,7 +127,7 @@ class context
return *this;
}

/*!
/**
* Terminate the current context.
*
* Any blocking calls other than a socket close will return with an error.
Expand All @@ -138,15 +138,15 @@ class context
void terminate();

#if (ZMQ_VERSION_MAJOR > 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR >= 2))
/*!
/**
* Set the value of an option in the underlaying zmq context.
*
* \param option a valid ::context_option
* \param value to set the option to
*/
void set(context_option const option, int const value);

/*!
/**
* Get a context option from the underlaying zmq context.
*
* \param option a valid ::context_option
Expand All @@ -155,7 +155,7 @@ class context
int get(context_option const option);
#endif

/*!
/**
* Validity checking of the context
*
* Checks if the underlying 0mq context for this instance is valid.
Expand All @@ -170,7 +170,7 @@ class context
return nullptr != _context;
}

/*!
/**
* Access to the raw 0mq context
*
* \return void pointer to the underlying 0mq context.
Expand Down
9 changes: 8 additions & 1 deletion src/zmqpp/curve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,16 @@
#include <string>
#include <zmq.h>

namespace zmqpp { namespace curve
namespace zmqpp {
/**
* ZMQ curve facilities.
*/
namespace curve
{

/**
* A pair of public and private key.
*/
struct keypair
{
std::string public_key;
Expand Down
12 changes: 6 additions & 6 deletions src/zmqpp/exception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace zmqpp

/** \todo Have a larger variety of exceptions with better state debug information */

/*!
/**
* Represents the base zmqpp exception.
*
* All zmqpp runtime exceptions are children of this class.
Expand All @@ -40,7 +40,7 @@ namespace zmqpp
class exception : public std::runtime_error
{
public:
/*!
/**
* Standard exception constructor.
*
* \param message a string representing the error message.
Expand All @@ -50,7 +50,7 @@ class exception : public std::runtime_error
{ }
};

/*!
/**
* Represents an attempt to use an invalid object.
*
* Objects may be invalid initially or after a shutdown or close.
Expand Down Expand Up @@ -90,7 +90,7 @@ class invalid_instance : public exception
}
};

/*!
/**
* Represents internal zmq errors.
*
* Any error response from the zmq bindings will be wrapped in this error.
Expand All @@ -100,15 +100,15 @@ class invalid_instance : public exception
class zmq_internal_exception : public exception
{
public:
/*!
/**
* Uses the zmq functions to pull out error messages and numbers.
*/
zmq_internal_exception()
: exception(zmq_strerror(zmq_errno()))
, _error(zmq_errno())
{ }

/*!
/**
* Retrieve the zmq error number associated with this exception.
* \return zmq error number
*/
Expand Down
4 changes: 2 additions & 2 deletions src/zmqpp/message.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
namespace zmqpp
{

/*!
/**
* \brief a zmq message with optional multipart support
*
* A zmq message is made up of one or more parts which are sent together to
Expand All @@ -43,7 +43,7 @@ namespace zmqpp
class message
{
public:
/*!
/**
* \brief callback to release user allocated data.
*
* The release function will be called on any void* moved part.
Expand Down
Loading

0 comments on commit 4784589

Please sign in to comment.