OpFlex Framework  1.3.0
opflex::ofcore::MockOFFramework Class Reference

A mock framework object that will not attempt to create remote connections or resolve references. More...

#include <opflex/ofcore/OFFramework.h>

Inheritance diagram for opflex::ofcore::MockOFFramework:
opflex::ofcore::OFFramework

Public Member Functions

virtual void start ()
 Start the framework. More...
 
virtual void stop ()
 Cleanly stop the framework.
 
- Public Member Functions inherited from opflex::ofcore::OFFramework
 OFFramework ()
 Create a new framework instance.
 
virtual ~OFFramework ()
 Destroy the framework instance.
 
void setModel (const modb::ModelMetadata &model)
 Add the given model metadata to the managed object database. More...
 
void setOpflexIdentity (const std::string &name, const std::string &domain)
 Set the opflex identity information for this framework instance. More...
 
void setOpflexIdentity (const std::string &name, const std::string &domain, const std::string &location)
 Set the opflex identity information for this framework instance. More...
 
virtual MainLoopAdaptorstartSync ()
 Start the framework in synchronous mode using a main loop adaptor. More...
 
virtual void dumpMODB (const std::string &file)
 Dump the managed object database to the file specified as a JSON blob. More...
 
virtual void dumpMODB (FILE *file)
 Dump the managed object database to the file specified as a JSON blob. More...
 
virtual void prettyPrintMODB (std::ostream &output, bool tree=true, bool includeProps=true, bool utf8=true)
 Pretty print the current MODB to the provided output stream. More...
 
virtual void enableSSL (const std::string &caStorePath, bool verifyPeers=true)
 Enable SSL for connections to opflex peers. More...
 
virtual void enableInspector (const std::string &socketName)
 Enable the MODB inspector service. More...
 
virtual void addPeer (const std::string &hostname, int port)
 Add an OpFlex peer. More...
 
virtual void registerPeerStatusListener (PeerStatusListener *listener)
 Register the given peer status listener to get updates on the health of the connection pool and on individual connections. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from opflex::ofcore::OFFramework
static const std::vector< int > & getVersion ()
 Get the library version as an vector of three version numbers: major, minor, and release.
 
static const std::string & getVersionStr ()
 Get the library version as a string of the format [major]. More...
 
static OFFrameworkdefaultInstance ()
 Get the static default instance of the framework.
 

Detailed Description

A mock framework object that will not attempt to create remote connections or resolve references.

This is useful for unit tests for code that uses the framework, since you can easily write into the store the objects that would have been resolved remotely without any interference.

Member Function Documentation

virtual void opflex::ofcore::MockOFFramework::start ( )
virtual

Start the framework.

This will start all the framework threads and attempt to connect to configured OpFlex peers.

Reimplemented from opflex::ofcore::OFFramework.


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