Kea  1.9.9-git
isc::yang::TranslatorBasic Class Reference

Between YANG and JSON translator class for basic values. More...

#include <translator.h>

+ Inheritance diagram for isc::yang::TranslatorBasic:

Public Member Functions

 TranslatorBasic (sysrepo::S_Session session, const std::string &model)
 Constructor. More...
 
virtual ~TranslatorBasic ()
 Destructor. More...
 
void delItem (const std::string &xpath)
 Delete basic value from YANG. More...
 
isc::data::ElementPtr getItem (const std::string &xpath)
 Get and translate basic value from YANG to JSON. More...
 
isc::data::ElementPtr getItems (const std::string &xpath)
 Get and translate a list of basic values from YANG to JSON. More...
 
sysrepo::S_Iter_Value getIter (const std::string &xpath)
 List iterator methods keeping the session private. More...
 
std::string getNext (sysrepo::S_Iter_Value iter)
 Get xpath of the next YANG list item. More...
 
void setItem (const std::string &xpath, isc::data::ConstElementPtr elem, sr_type_t type)
 Translate and set basic value from JSON to YANG. More...
 

Static Public Member Functions

static isc::data::ElementPtr value (sysrepo::S_Val s_val)
 Translate basic value from YANG to JSON. More...
 
static sysrepo::S_Val value (isc::data::ConstElementPtr elem, sr_type_t type)
 Translate basic value from JSON to YANG. More...
 

Protected Attributes

std::string model_
 The model. More...
 
sysrepo::S_Session session_
 The sysrepo session. More...
 

Detailed Description

Between YANG and JSON translator class for basic values.

Definition at line 27 of file translator.h.

Constructor & Destructor Documentation

isc::yang::TranslatorBasic::TranslatorBasic ( sysrepo::S_Session  session,
const std::string &  model 
)

Constructor.

Parameters
sessionSysrepo session.
modelModel name (used and shared by derived classes).

Definition at line 43 of file translator.cc.

isc::yang::TranslatorBasic::~TranslatorBasic ( )
virtual

Destructor.

Definition at line 47 of file translator.cc.

Member Function Documentation

void isc::yang::TranslatorBasic::delItem ( const std::string &  xpath)

Delete basic value from YANG.

Parameters
xpathThe xpath of the basic value.

Definition at line 304 of file translator.cc.

References isc_throw, session_, and isc::Exception::what().

Referenced by isc::yang::TranslatorConfig::delConfigIetf6(), isc::yang::TranslatorConfig::delConfigKea(), isc::yang::TranslatorControlSocket::setControlSocketKea(), isc::yang::TranslatorDatabase::setDatabaseKea(), and isc::yang::TranslatorDatabases::setDatabasesKea().

+ Here is the call graph for this function:

ElementPtr isc::yang::TranslatorBasic::getItem ( const std::string &  xpath)
ElementPtr isc::yang::TranslatorBasic::getItems ( const std::string &  xpath)

Get and translate a list of basic values from YANG to JSON.

Parameters
xpathThe xpath of the list of basic values.
Returns
The ListElement representing the leaf-list at xpath or null when not found.

Definition at line 126 of file translator.cc.

References isc_throw, session_, value(), and isc::Exception::what().

Referenced by isc::yang::TranslatorHost::getHostKea(), isc::yang::TranslatorPdPool::getPdPoolKea(), isc::yang::TranslatorPool::getPoolKea(), isc::yang::TranslatorConfig::getServerKeaDhcp4(), isc::yang::TranslatorConfig::getServerKeaDhcp6(), isc::yang::TranslatorConfig::getServerKeaDhcpCommon(), isc::yang::TranslatorSharedNetwork::getSharedNetworkKea(), and isc::yang::TranslatorSubnet::getSubnetKea().

+ Here is the call graph for this function:

ElementPtr isc::yang::TranslatorBasic::value ( sysrepo::S_Val  s_val)
static

Translate basic value from YANG to JSON.

Note
Please don't use this outside tests.
Parameters
s_valThe value.
Returns
The Element representing the sysrepo value.
Exceptions
NotImplementedwhen the value type is not supported.

Definition at line 52 of file translator.cc.

References isc_throw.

Referenced by getItem(), getItems(), and setItem().

S_Val isc::yang::TranslatorBasic::value ( isc::data::ConstElementPtr  elem,
sr_type_t  type 
)
static

Translate basic value from JSON to YANG.

Note
Please don't use this outside tests.
Parameters
elemThe JSON element.
typeThe sysrepo type.

Definition at line 147 of file translator.cc.

References isc_throw.

Member Data Documentation

std::string isc::yang::TranslatorBasic::model_
protected

The model.

Definition at line 132 of file translator.h.

Referenced by isc::yang::TranslatorConfig::delConfigIetf6(), isc::yang::TranslatorConfig::delConfigKea(), isc::yang::TranslatorClass::getClass(), isc::yang::TranslatorClasses::getClasses(), isc::yang::TranslatorClass::getClassKea(), isc::yang::TranslatorConfig::getConfig(), isc::yang::TranslatorConfig::getConfigIetf6(), isc::yang::TranslatorControlSocket::getControlSocket(), isc::yang::TranslatorDatabase::getDatabase(), isc::yang::TranslatorDatabases::getDatabases(), isc::yang::TranslatorHost::getHost(), isc::yang::TranslatorHost::getHostKea(), isc::yang::TranslatorLogger::getLogger(), isc::yang::TranslatorLoggers::getLoggers(), isc::yang::TranslatorOptionData::getOptionData(), isc::yang::TranslatorOptionDataList::getOptionDataList(), isc::yang::TranslatorOptionDef::getOptionDef(), isc::yang::TranslatorOptionDefList::getOptionDefList(), isc::yang::TranslatorPdPool::getPdPool(), isc::yang::TranslatorPdPools::getPdPools(), isc::yang::TranslatorPool::getPool(), isc::yang::TranslatorPools::getPools(), isc::yang::TranslatorSharedNetwork::getSharedNetwork(), isc::yang::TranslatorSubnet::getSubnet(), isc::yang::TranslatorSubnet::getSubnetIetf6(), isc::yang::TranslatorSubnet::getSubnetKea(), isc::yang::TranslatorSubnets::getSubnets(), isc::yang::TranslatorClass::setClass(), isc::yang::TranslatorClasses::setClasses(), isc::yang::TranslatorClass::setClassKea(), isc::yang::TranslatorConfig::setConfig(), isc::yang::TranslatorConfig::setConfigIetf6(), isc::yang::TranslatorControlSocket::setControlSocket(), isc::yang::TranslatorDatabase::setDatabase(), isc::yang::TranslatorDatabases::setDatabases(), isc::yang::TranslatorHost::setHost(), isc::yang::TranslatorHost::setHostKea(), isc::yang::TranslatorHosts::setHosts(), isc::yang::TranslatorHosts::setHostsKea(), isc::yang::TranslatorLogger::setLogger(), isc::yang::TranslatorLoggers::setLoggers(), isc::yang::TranslatorOptionData::setOptionData(), isc::yang::TranslatorOptionDataList::setOptionDataList(), isc::yang::TranslatorOptionDef::setOptionDef(), isc::yang::TranslatorOptionDefList::setOptionDefList(), isc::yang::TranslatorPdPool::setPdPool(), isc::yang::TranslatorPdPools::setPdPools(), isc::yang::TranslatorPool::setPool(), isc::yang::TranslatorPools::setPools(), isc::yang::TranslatorSharedNetwork::setSharedNetwork(), isc::yang::TranslatorSharedNetworks::setSharedNetworks(), isc::yang::TranslatorSubnet::setSubnet(), isc::yang::TranslatorSubnet::setSubnetIetf6(), isc::yang::TranslatorSubnet::setSubnetKea(), and isc::yang::TranslatorSubnets::setSubnets().

sysrepo::S_Session isc::yang::TranslatorBasic::session_
protected

The sysrepo session.

Definition at line 126 of file translator.h.

Referenced by delItem(), getItem(), getItems(), getIter(), getNext(), and setItem().


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