MADARA  3.2.3
madara::transport::ZMQContext Class Reference

A class that manages a ZMQ context. More...

#include <ZMQContext.h>

Public Member Functions

 ZMQContext ()
 Constructor. More...
 
 ~ZMQContext ()
 Destructor. More...
 
void add_ref (void)
 Adds a reference to the context. More...
 
void destroy_context (void)
 Destroys the underlying context. More...
 
void * get_context ()
 Retrieves the underlying ZMQ context. More...
 
void rem_ref (void)
 Removes a reference to the context. More...
 
void set_context (void *context)
 Retrieves the underlying ZMQ context. More...
 

Private Attributes

void * context_
 the context More...
 
std::atomic< int > references_
 track the number of references to the context More...
 

Detailed Description

A class that manages a ZMQ context.

Definition at line 23 of file ZMQContext.h.

Constructor & Destructor Documentation

madara::transport::ZMQContext::ZMQContext ( )

Constructor.

Parameters
contextthe context to manage

Definition at line 7 of file ZMQContext.cpp.

madara::transport::ZMQContext::~ZMQContext ( )

Destructor.

Definition at line 108 of file ZMQContext.cpp.

Member Function Documentation

void madara::transport::ZMQContext::add_ref ( void  )

Adds a reference to the context.

This is useful for very lazy compilers that do not forcefully call destructors of global variables, such as VS apparently does.

Definition at line 42 of file ZMQContext.cpp.

void madara::transport::ZMQContext::destroy_context ( void  )

Destroys the underlying context.

Definition at line 90 of file ZMQContext.cpp.

void* madara::transport::ZMQContext::get_context ( void  )
inline

Retrieves the underlying ZMQ context.

Returns
current ZMQ context

Definition at line 46 of file ZMQContext.h.

void madara::transport::ZMQContext::rem_ref ( void  )

Removes a reference to the context.

This is useful for very lazy compilers that do not forcefully call destructors of global variables, such as VS apparently does.

Definition at line 66 of file ZMQContext.cpp.

void madara::transport::ZMQContext::set_context ( void *  context)

Retrieves the underlying ZMQ context.

Parameters
contextthe context to manage

Definition at line 13 of file ZMQContext.cpp.

Member Data Documentation

void* madara::transport::ZMQContext::context_
private

the context

Definition at line 74 of file ZMQContext.h.

std::atomic<int> madara::transport::ZMQContext::references_
private

track the number of references to the context

Definition at line 77 of file ZMQContext.h.


The documentation for this class was generated from the following files: