Added methods to get and set at once multiple parameters of a circuit.

git-svn-id: http://yate.null.ro/svn/yate/trunk@2780 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2009-08-07 09:46:55 +00:00
parent de014141dd
commit aefe3765e9
2 changed files with 29 additions and 0 deletions

View File

@ -449,6 +449,19 @@ SignallingCircuit::~SignallingCircuit()
XDebug(m_group,DebugAll,"SignallingCircuit::~SignallingCircuit [%p]",this);
}
// Set circuit data from a list of parameters
bool SignallingCircuit::setParams(const NamedList& params)
{
bool ok = true;
unsigned int n = params.length();
for (unsigned int i = 0; i < n; i++) {
NamedString* param = params.getParam(i);
if (param && !setParam(param->name(),*param))
ok = false;
}
return ok;
}
// Get first event from queue
SignallingCircuitEvent* SignallingCircuit::getEvent(const Time& when)
{

View File

@ -1518,6 +1518,13 @@ public:
virtual bool setParam(const String& param, const String& value)
{ return false; }
/**
* Set circuit data from a list of parameters
* @param params Parameter list to set in the circuit
* @return True if all parameters were succesfully set
*/
virtual bool setParams(const NamedList& params);
/**
* Get circuit parameter
* @param param The parameter to get
@ -1527,6 +1534,15 @@ public:
virtual bool getParam(const String& param, String& value) const
{ return false; }
/**
* Get circuit parameters
* @param params Parameter list to fill from the circuit
* @param category Optional category used to select desired parameters
* @return True if handled
*/
virtual bool getParams(NamedList& params, const String& category = String::empty())
{ return false; }
/**
* Get the group of circuits this one belongs to
* @return Pointer to circuit group