#include <directives.h>
Inheritance diagram for conf::ConfBlock:
Public Member Functions | |
ConfBlock (std::string const &name, bool reloadable=true) | |
Constructor setting directive name and reloadability. | |
ConfBlock (ConfBlock const &cd) | |
Copy constructor. | |
virtual | ~ConfBlock () |
Destructor. | |
virtual ConfBlock & | operator= (ConfBlock const &right) |
Assignment operator. | |
virtual bool | operator== (ConfBlock const &) const |
== operator | |
virtual bool | begin (Conf &conf) |
Begin parsing. | |
virtual bool | set (Conf &conf, unsigned short count, std::string const params[]) |
Parses the block. | |
virtual bool | end (Conf &conf) |
End parsing. | |
virtual Conf const * | sub () const |
Implements ConfDir::sub(). | |
Protected Member Functions | |
virtual bool | add (Conf &conf, Conf &new_conf)=0 |
Adds directives to a Conf object. | |
virtual bool | apply_changes (Conf &conf) |
Applies changes. | |
Protected Attributes | |
Conf * | m_conf |
Created parser -- 0 until first successful call to begin(). |
It can't be used directly; instead, you must create a derived class that will override the add() function to add new directives to the Conf object that is created in the begin() function.
In your derived classes, you'll generally want to aggregate the directives objects too. That'll allow you to use the ConfBlock class with the ConfArray template class.
|
This function must be overriden in derived classes to add directives to the given Conf object.
Implemented in conf::ConfHostPort, xlog::LogRules, and modules::ConfModule. |
|
This function is called automatically by end() whenever the configuration is reloaded. Use it to apply changes to the program if necessary.
|
|
Creates the conf parser, deleting the old parser if necessary, then calls add() to initialize the list of directives, then Conf::begin() to initialize it and sets the m_conf object to the newly-created object. Reimplemented from conf::ConfDir. Reimplemented in conf::ConfBoolBlock, and conf::ConfRules. |
|
Calls apply_changes() and m_conf->end(). Reimplemented from conf::ConfDir. |
|
This operator is provided in order to use the ConfArray template class. It always return false though (how the heck would we check reliably that two directives have the same value?! We don't even know if they _have_ a value! ;) |
|
Parses the block of directives in params[0]. Reimplemented from conf::ConfDir. Reimplemented in conf::ConfBoolBlock. |