11 #ifndef GI_LLDP_CONFIG_HPP 12 #define GI_LLDP_CONFIG_HPP 14 #include <boost/optional.hpp> 15 #include "opflex/modb/URIBuilder.h" 16 #include "opflex/modb/mo-internal/MO.h" 22 :
public opflex::modb::mointernal::MO
29 static const opflex::modb::class_id_t
CLASS_ID = 65;
37 return getObjectInstance().isSet(2129921ul, opflex::modb::PropertyInfo::STRING);
44 boost::optional<const std::string&>
getName()
47 return getObjectInstance().getString(2129921ul);
56 const std::string&
getName(
const std::string& defaultValue)
58 return getName().get_value_or(defaultValue);
71 getTLMutator().modify(getClassId(), getURI())->setString(2129921ul, newValue);
83 getTLMutator().modify(getClassId(), getURI())->unset(2129921ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
93 return getObjectInstance().isSet(2129922ul, opflex::modb::PropertyInfo::ENUM8);
100 boost::optional<const uint8_t>
getRx()
103 return (
const uint8_t)getObjectInstance().getUInt64(2129922ul);
112 const uint8_t
getRx(
const uint8_t defaultValue)
114 return getRx().get_value_or(defaultValue);
127 getTLMutator().modify(getClassId(), getURI())->setUInt64(2129922ul, newValue);
139 getTLMutator().modify(getClassId(), getURI())->unset(2129922ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
149 return getObjectInstance().isSet(2129923ul, opflex::modb::PropertyInfo::ENUM8);
156 boost::optional<const uint8_t>
getTx()
159 return (
const uint8_t)getObjectInstance().getUInt64(2129923ul);
168 const uint8_t
getTx(
const uint8_t defaultValue)
170 return getTx().get_value_or(defaultValue);
183 getTLMutator().modify(getClassId(), getURI())->setUInt64(2129923ul, newValue);
195 getTLMutator().modify(getClassId(), getURI())->unset(2129923ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
210 static boost::optional<OF_SHARED_PTR<modelgbp::lldp::Config> >
resolve(
211 opflex::ofcore::OFFramework& framework,
212 const opflex::modb::URI& uri)
214 return opflex::modb::mointernal::MO::resolve<modelgbp::lldp::Config>(framework,
CLASS_ID, uri);
228 static boost::optional<OF_SHARED_PTR<modelgbp::lldp::Config> >
resolve(
229 const opflex::modb::URI& uri)
231 return opflex::modb::mointernal::MO::resolve<modelgbp::lldp::Config>(opflex::ofcore::OFFramework::defaultInstance(),
CLASS_ID, uri);
250 static boost::optional<OF_SHARED_PTR<modelgbp::lldp::Config> >
resolve(
251 opflex::ofcore::OFFramework& framework,
252 const std::string& platformConfigName)
254 return resolve(framework,opflex::modb::URIBuilder().addElement(
"PolicyUniverse").addElement(
"PlatformConfig").addElement(platformConfigName).addElement(
"LldpConfig").build());
272 static boost::optional<OF_SHARED_PTR<modelgbp::lldp::Config> >
resolve(
273 const std::string& platformConfigName)
275 return resolve(opflex::ofcore::OFFramework::defaultInstance(),platformConfigName);
288 getTLMutator().remove(
CLASS_ID, getURI());
301 static void remove(opflex::ofcore::OFFramework& framework,
302 const opflex::modb::URI& uri)
304 MO::remove(framework,
CLASS_ID, uri);
317 static void remove(
const opflex::modb::URI& uri)
319 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
337 opflex::ofcore::OFFramework& framework,
338 const std::string& platformConfigName)
340 MO::remove(framework,
CLASS_ID, opflex::modb::URIBuilder().addElement(
"PolicyUniverse").addElement(
"PlatformConfig").addElement(platformConfigName).addElement(
"LldpConfig").build());
358 const std::string& platformConfigName)
360 remove(opflex::ofcore::OFFramework::defaultInstance(),platformConfigName);
375 opflex::ofcore::OFFramework& framework,
376 opflex::modb::ObjectListener* listener)
378 opflex::modb::mointernal
379 ::MO::registerListener(framework, listener,
CLASS_ID);
394 opflex::modb::ObjectListener* listener)
406 opflex::ofcore::OFFramework& framework,
407 opflex::modb::ObjectListener* listener)
409 opflex::modb::mointernal
410 ::MO::unregisterListener(framework, listener,
CLASS_ID);
420 opflex::modb::ObjectListener* listener)
430 opflex::ofcore::OFFramework& framework,
431 const opflex::modb::URI& uri,
432 const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
433 : MO(framework,
CLASS_ID, uri, oi) { }
438 #endif // GI_LLDP_CONFIG_HPP static void registerListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Register a listener that will get called for changes related to this class.
Definition: lldp/Config.hpp:374
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for Config.
Definition: lldp/Config.hpp:29
static void registerListener(opflex::modb::ObjectListener *listener)
Register a listener that will get called for changes related to this class with the default framework...
Definition: lldp/Config.hpp:393
bool isRxSet()
Check whether rx has been set.
Definition: lldp/Config.hpp:91
Definition: lldp/Config.hpp:21
modelgbp::lldp::Config & unsetRx()
Unset rx in the currently-active mutator.
Definition: lldp/Config.hpp:137
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: lldp/Config.hpp:419
Config(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of Config.
Definition: lldp/Config.hpp:429
boost::optional< const uint8_t > getRx()
Get the value of rx if it has been set.
Definition: lldp/Config.hpp:100
boost::optional< const uint8_t > getTx()
Get the value of tx if it has been set.
Definition: lldp/Config.hpp:156
const uint8_t getTx(const uint8_t defaultValue)
Get the value of tx if set, otherwise the value of default passed in.
Definition: lldp/Config.hpp:168
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition: lldp/Config.hpp:56
static boost::optional< OF_SHARED_PTR< modelgbp::lldp::Config > > resolve(const std::string &platformConfigName)
Retrieve an instance of Config from the default managed object store by constructing its URI from the...
Definition: lldp/Config.hpp:272
modelgbp::lldp::Config & setTx(const uint8_t newValue)
Set tx to the specified value in the currently-active mutator.
Definition: lldp/Config.hpp:181
modelgbp::lldp::Config & unsetName()
Unset name in the currently-active mutator.
Definition: lldp/Config.hpp:81
modelgbp::lldp::Config & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition: lldp/Config.hpp:69
bool isTxSet()
Check whether tx has been set.
Definition: lldp/Config.hpp:147
modelgbp::lldp::Config & unsetTx()
Unset tx in the currently-active mutator.
Definition: lldp/Config.hpp:193
modelgbp::lldp::Config & setRx(const uint8_t newValue)
Set rx to the specified value in the currently-active mutator.
Definition: lldp/Config.hpp:125
static boost::optional< OF_SHARED_PTR< modelgbp::lldp::Config > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of Config from the managed object store using the default framework instance...
Definition: lldp/Config.hpp:228
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition: lldp/Config.hpp:44
static boost::optional< OF_SHARED_PTR< modelgbp::lldp::Config > > resolve(opflex::ofcore::OFFramework &framework, const std::string &platformConfigName)
Retrieve an instance of Config from the managed object store by constructing its URI from the path el...
Definition: lldp/Config.hpp:250
const uint8_t getRx(const uint8_t defaultValue)
Get the value of rx if set, otherwise the value of default passed in.
Definition: lldp/Config.hpp:112
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: lldp/Config.hpp:405
bool isNameSet()
Check whether name has been set.
Definition: lldp/Config.hpp:35
static boost::optional< OF_SHARED_PTR< modelgbp::lldp::Config > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Config from the managed object store.
Definition: lldp/Config.hpp:210
SOME COPYRIGHT.
Definition: OpcodeEnumT.hpp:12