11#ifndef GI_STP_CONFIG_HPP
12#define GI_STP_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 = 80;
37 return getObjectInstance().isSet(2621443ul, opflex::modb::PropertyInfo::ENUM8);
47 return (
const uint8_t)getObjectInstance().getUInt64(2621443ul);
71 getTLMutator().modify(getClassId(), getURI())->setUInt64(2621443ul, newValue);
83 getTLMutator().modify(getClassId(), getURI())->unset(2621443ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
93 return getObjectInstance().isSet(2621442ul, opflex::modb::PropertyInfo::ENUM8);
103 return (
const uint8_t)getObjectInstance().getUInt64(2621442ul);
127 getTLMutator().modify(getClassId(), getURI())->setUInt64(2621442ul, newValue);
139 getTLMutator().modify(getClassId(), getURI())->unset(2621442ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
149 return getObjectInstance().isSet(2621441ul, opflex::modb::PropertyInfo::STRING);
159 return getObjectInstance().getString(2621441ul);
168 const std::string&
getName(
const std::string& defaultValue)
170 return getName().get_value_or(defaultValue);
183 getTLMutator().modify(getClassId(), getURI())->setString(2621441ul, newValue);
195 getTLMutator().modify(getClassId(), getURI())->unset(2621441ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
210 static boost::optional<OF_SHARED_PTR<modelgbp::stp::Config> >
resolve(
211 opflex::ofcore::OFFramework& framework,
212 const opflex::modb::URI& uri)
214 return opflex::modb::mointernal::MO::resolve<modelgbp::stp::Config>(framework,
CLASS_ID, uri);
228 static boost::optional<OF_SHARED_PTR<modelgbp::stp::Config> >
resolve(
229 const opflex::modb::URI& uri)
231 return opflex::modb::mointernal::MO::resolve<modelgbp::stp::Config>(opflex::ofcore::OFFramework::defaultInstance(),
CLASS_ID, uri);
250 static boost::optional<OF_SHARED_PTR<modelgbp::stp::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(
"StpConfig").build());
272 static boost::optional<OF_SHARED_PTR<modelgbp::stp::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(
"StpConfig").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) { }
Definition stp/Config.hpp:23
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 stp/Config.hpp:393
static void remove(const std::string &platformConfigName)
Remove the Config object with the specified path elements from the managed object store using the def...
Definition stp/Config.hpp:357
modelgbp::stp::Config & setBpduFilter(const uint8_t newValue)
Set bpduFilter to the specified value in the currently-active mutator.
Definition stp/Config.hpp:69
void remove()
Remove this instance using the currently-active mutator.
Definition stp/Config.hpp:286
static boost::optional< OF_SHARED_PTR< modelgbp::stp::Config > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Config from the managed object store.
Definition stp/Config.hpp:210
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition stp/Config.hpp:168
static void remove(opflex::ofcore::OFFramework &framework, const std::string &platformConfigName)
Remove the Config object with the specified path elements from the managed object store.
Definition stp/Config.hpp:336
const uint8_t getBpduFilter(const uint8_t defaultValue)
Get the value of bpduFilter if set, otherwise the value of default passed in.
Definition stp/Config.hpp:56
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 stp/Config.hpp:374
modelgbp::stp::Config & setBpduGuard(const uint8_t newValue)
Set bpduGuard to the specified value in the currently-active mutator.
Definition stp/Config.hpp:125
bool isBpduGuardSet()
Check whether bpduGuard has been set.
Definition stp/Config.hpp:91
static void remove(const opflex::modb::URI &uri)
Remove the Config object with the specified URI using the currently-active mutator and the default fr...
Definition stp/Config.hpp:317
static boost::optional< OF_SHARED_PTR< modelgbp::stp::Config > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of Config from the managed object store using the default framework instance.
Definition stp/Config.hpp:228
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition stp/Config.hpp:419
bool isNameSet()
Check whether name has been set.
Definition stp/Config.hpp:147
const uint8_t getBpduGuard(const uint8_t defaultValue)
Get the value of bpduGuard if set, otherwise the value of default passed in.
Definition stp/Config.hpp:112
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for Config.
Definition stp/Config.hpp:29
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition stp/Config.hpp:405
modelgbp::stp::Config & unsetBpduFilter()
Unset bpduFilter in the currently-active mutator.
Definition stp/Config.hpp:81
bool isBpduFilterSet()
Check whether bpduFilter has been set.
Definition stp/Config.hpp:35
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 stp/Config.hpp:429
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition stp/Config.hpp:156
modelgbp::stp::Config & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition stp/Config.hpp:181
boost::optional< const uint8_t > getBpduGuard()
Get the value of bpduGuard if it has been set.
Definition stp/Config.hpp:100
modelgbp::stp::Config & unsetBpduGuard()
Unset bpduGuard in the currently-active mutator.
Definition stp/Config.hpp:137
static boost::optional< OF_SHARED_PTR< modelgbp::stp::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 stp/Config.hpp:250
static boost::optional< OF_SHARED_PTR< modelgbp::stp::Config > > resolve(const std::string &platformConfigName)
Retrieve an instance of Config from the default managed object store by constructing its URI from the...
Definition stp/Config.hpp:272
static void remove(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Remove the Config object with the specified URI using the currently-active mutator.
Definition stp/Config.hpp:301
boost::optional< const uint8_t > getBpduFilter()
Get the value of bpduFilter if it has been set.
Definition stp/Config.hpp:44
modelgbp::stp::Config & unsetName()
Unset name in the currently-active mutator.
Definition stp/Config.hpp:193
SOME COPYRIGHT.
Definition OpcodeEnumT.hpp:12