Aria  2.8.0
ArConfigSection Class Reference

Represents a section in the configuration. More...

#include <ArConfig.h>

Public Member Functions

bool addFlags (const char *flags, bool isQuiet=false)
 
 ArConfigSection (const char *name=NULL, const char *comment=NULL, bool isQuiet=false, const char *categoryName=NULL)
 
 ArConfigSection (const ArConfigSection &section)
 
bool containsParamsOfPriority (ArPriority::Priority highestPriority, ArPriority::Priority lowestPriority)
 Determines whether the current section contains parameters in the specified priority ran.
 
virtual void copyAndDetach (const ArConfigSection &section)
 Copies the given section to this one, detaching any pointers so they are not shared.
 
ArConfigArgfindParam (const char *paramName, bool isAllowStringHolders=false)
 Finds a parameter item in this section with the given name. Returns NULL if not found.
 
ArConfigArgfindParam (const std::list< std::string > &paramNamePath, bool isAllowHolders=false)
 Finds a list member parameter with the specified name path. Returns NULL if not found. More...
 
ArConfigArgfindParam (const char **paramNamePath, int pathLength, bool isAllowHolders=false)
 Finds a list member parameter with the specified name path. Returns NULL if not found.
 
const char * getCategoryName () const
 Returns the name of the category that contains this section.
 
const char * getComment (void) const
 
const char * getFlags (void) const
 
const char * getName (void) const
 
std::list< ArConfigArg > * getParams (void)
 
bool hasFlag (const char *flag) const
 
ArConfigSectionoperator= (const ArConfigSection &section)
 
bool remFlag (const char *dataFlag)
 
bool remStringHolder (const char *paramName)
 Removes a string holder for this param, returns true if it found one.
 
void setComment (const char *comment)
 
void setName (const char *name)
 
void setQuiet (bool isQuiet)
 Turn on this flag to reduce the number of verbose log messages.
 

Protected Member Functions

void setCategoryName (const char *categoryName)
 Sets the name of the category to which this section belongs.
 

Protected Attributes

std::string myCategoryName
 
std::string myComment
 
std::string myDisplayName
 
ArArgumentBuildermyFlags
 
bool myIsQuiet
 
std::string myName
 
std::list< ArConfigArgmyParams
 

Friends

class ArConfig
 Give the config access to the protected category name setter.
 

Detailed Description

Represents a section in the configuration.

Sections are used to group items used by separate parts of Aria.

Examples:
configExample.cpp.

Member Function Documentation

◆ findParam()

ArConfigArg * ArConfigSection::findParam ( const std::list< std::string > &  paramNamePath,
bool  isAllowHolders = false 
)

Finds a list member parameter with the specified name path. Returns NULL if not found.

This method provides a shortcut for looking up child parameters in a list type parameter that is contained in the section.

For example: std::list<std::string> maxRangeP; maxRangeP.push_back(laserName); maxRangeP.push_back("LMS2xxInfo"); maxRangeP.push_back("MaxRange"); ArConfigArg *maxRangeArg = section->findParam(maxRangeP);

if(maxRangeArg) { ...

This is functionally equivalent to the following, but better for long sequences. ArConfigArg *laserListArg = section->findParam(laserName); if(laserListArg) { ArConfigArg *lms2xxArg = laserListArg->findArg("LMS2xxInfo"); if(lms2xxArg) { ArConfigArg *maxRangeArg = lms2xxxArg->findArg("MaxRange"); if(maxRangeArg) { ... } else { ... ... ... etc.

Parameters
paramNamePatha list of strings that specifies the sequence of parameter names, from "top" to "bottom"
Returns
ArConfigArg *, a pointer to the requested parameter, or NULL if not found

◆ getComment()

const char* ArConfigSection::getComment ( void  ) const
inline
Returns
A comment describing this section

◆ getName()

const char* ArConfigSection::getName ( void  ) const
inline
Returns
The name of this section

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