OpFlex Framework 1.7.0
opflex::ofcore::InspectorClient Class Referenceabstract

Inspect the state of a a managed object database using the inspector protocol. More...

#include <opflex/ofcore/InspectorClient.h>

Inheritance diagram for opflex::ofcore::InspectorClient:

Public Member Functions

virtual ~InspectorClient ()
 Destroy the inspector client.
 
virtual void setFollowRefs (bool enabled)=0
 Follow references for retrieved objects.
 
virtual void setRecursive (bool enabled)=0
 Download the whole subtree rather than just the specific object for each query.
 
virtual void addQuery (const std::string &subject, const modb::URI &uri)=0
 Query for a particular managed object.
 
virtual void addClassQuery (const std::string &subject)=0
 Query for all managed objects of a particular type.
 
virtual void execute ()=0
 Attempt to execute all queued inspector commands.
 
virtual void dumpToFile (FILE *file)=0
 Dump the current MODB view to the specified file using the Opflex JSON wire format.
 
virtual size_t loadFromFile (FILE *file)=0
 Load a set of managed objects from the given file into the inspector's MODB view in order to display them.
 
virtual void prettyPrint (std::ostream &output, bool tree=true, bool includeProps=true, bool utf8=true, size_t truncate=0)=0
 Pretty print the current MODB to the provided output stream.
 

Static Public Member Functions

static InspectorClientnewInstance (const std::string &name, const modb::ModelMetadata &model)
 Allocate a new inspector client for the given socket name.
 

Detailed Description

Inspect the state of a a managed object database using the inspector protocol.

Can query for objects, dump the database state, and other simple tasks.

Use the client by queuing a list of commands, which will then be executed in sequence. Commands will operate to change the state of the client's view of the managed object database by querying the server. The client's view can then either be pretty-printed for viewing by a user or dumped to a file.

Member Function Documentation

◆ addClassQuery()

virtual void opflex::ofcore::InspectorClient::addClassQuery ( const std::string & subject)
pure virtual

Query for all managed objects of a particular type.

Parameters
subjectthe subject (class name) to query for

◆ addQuery()

virtual void opflex::ofcore::InspectorClient::addQuery ( const std::string & subject,
const modb::URI & uri )
pure virtual

Query for a particular managed object.

Parameters
subjectthe subject (class name) of the object
urithe URI of the object

◆ dumpToFile()

virtual void opflex::ofcore::InspectorClient::dumpToFile ( FILE * file)
pure virtual

Dump the current MODB view to the specified file using the Opflex JSON wire format.

Parameters
filethe file name to write to

◆ loadFromFile()

virtual size_t opflex::ofcore::InspectorClient::loadFromFile ( FILE * file)
pure virtual

Load a set of managed objects from the given file into the inspector's MODB view in order to display them.

Parameters
filethe file to load from
Returns
the number of managed objects loaded

◆ newInstance()

static InspectorClient * opflex::ofcore::InspectorClient::newInstance ( const std::string & name,
const modb::ModelMetadata & model )
static

Allocate a new inspector client for the given socket name.

Parameters
nameA path name for the unix socket
modelthe model metadata object

◆ prettyPrint()

virtual void opflex::ofcore::InspectorClient::prettyPrint ( std::ostream & output,
bool tree = true,
bool includeProps = true,
bool utf8 = true,
size_t truncate = 0 )
pure virtual

Pretty print the current MODB to the provided output stream.

Parameters
outputthe output stream to write to
treeprint in a tree format
includePropsinclude the object properties
utf8output tree using UTF-8 box drawing
truncatetruncate lines to the specified number of characters. 0 means do not truncate.

◆ setFollowRefs()

virtual void opflex::ofcore::InspectorClient::setFollowRefs ( bool enabled)
pure virtual

Follow references for retrieved objects.

Parameters
enabledset to true to enable reference following

◆ setRecursive()

virtual void opflex::ofcore::InspectorClient::setRecursive ( bool enabled)
pure virtual

Download the whole subtree rather than just the specific object for each query.

Parameters
enabledset to true to enable recursive downloading

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