libRoadRunner Plugin C++ API  1.0.0
 All Classes Files Functions Variables Friends Pages
Public Member Functions | Protected Attributes | Friends | List of all members
rrp::Parameters Class Reference

#include <rrParameters.h>

Public Member Functions

 Parameters (bool canClear=true)
 
virtual ~Parameters ()
 
 Parameters (const Parameters &cpyMe)
 
void add (PluginParameter *para, bool ownMemory=false)
 
rr::StringList getNames () const
 
u_int count () const
 
const PluginParameteroperator[] (const int &i) const
 
PluginParameteroperator[] (const int &i)
 
PluginParametergetParameter (const string &paraName)
 
PluginParametergetFirst ()
 
PluginParametergetNext ()
 
PluginParametergetPrevious ()
 
PluginParametergetCurrent ()
 
bool clear ()
 

Protected Attributes

vector< pair< PluginParameter
*, bool > > 
mParas
 
vector< pair< PluginParameter
*, bool > >::iterator 
mParasIter
 
bool mCanClientClearList
 

Friends

ostream & operator<< (ostream &os, const Parameters &pars)
 

Detailed Description

Container for Plugin parameters.

Constructor & Destructor Documentation

rrp::Parameters::Parameters ( bool  canClear = true)

Create a parameter container

rrp::Parameters::~Parameters ( )
virtual

Deallocate memory allocated

rrp::Parameters::Parameters ( const Parameters cpyMe)

Copy constructor

Member Function Documentation

void rrp::Parameters::add ( PluginParameter para,
bool  ownMemory = false 
)

Add a parameter. By default, the container do not owe memory allocated by the parameter. If the ownMemory flag is set to true, the container will de allocate memory for the parameter as well

Parameters
paraA pointer to a Plugin parameter
ownMemoryBoolean flag indicating if the container is owing the memory of the parameter or not.
bool rrp::Parameters::clear ( )

Empty the parameter container

u_int rrp::Parameters::count ( ) const

Return number of parameters in the container.

PluginParameter * rrp::Parameters::getCurrent ( )

Get Current Parameter. De Advances the internal iterator to next element

Returns
A Pointer to a PluginParameter if present, NULL otherwise
PluginParameter * rrp::Parameters::getFirst ( )

Get First Parameter. Resets the internal iterator to first element

Returns
A Pointer to a PluginParameter if present, NULL otherwise
StringList rrp::Parameters::getNames ( ) const

Return parameters in the container as a list of strings.

PluginParameter * rrp::Parameters::getNext ( )

Get Next Parameter. Advances the internal iterator to next element

Returns
A Pointer to a PluginParameter if present, NULL otherwise
PluginParameter * rrp::Parameters::getParameter ( const string &  paraName)

Get a parameter with a specific name

Returns
A Pointer to a PluginParameter if present, NULL otherwise
PluginParameter * rrp::Parameters::getPrevious ( )

Get Previous Parameter. De Advances the internal iterator to next element

Returns
A Pointer to a PluginParameter if present, NULL otherwise
const PluginParameter * rrp::Parameters::operator[] ( const int &  i) const

Access a parameter using operator []

Returns
A const Pointer to a PluginParameter
PluginParameter * rrp::Parameters::operator[] ( const int &  i)

Access a parameter using operator []

Returns
A Pointer to a PluginParameter

Friends And Related Function Documentation

ostream& operator<< ( ostream &  os,
const Parameters pars 
)
friend

Output the container to a output stream (ostream)

Member Data Documentation

bool rrp::Parameters::mCanClientClearList
protected

Boolean indicating if a client of the container can clear the list. True by default

vector< pair<PluginParameter*, bool> > rrp::Parameters::mParas
protected

The parameter container may owe the parameter, default is false. In certain ciscumstances, the container need to owe the memory of the parameter and will de allocate it on clear, or in the destruction of the container.

Todo:
Change the container to a std::list.

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