11 #ifndef GI_EPR_L3NET_HPP
12 #define GI_EPR_L3NET_HPP
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
20 #include "modelgbp/gbpe/Attestation.hpp"
26 :
public opflex::modb::mointernal::MO
33 static const opflex::modb::class_id_t
CLASS_ID = 83;
41 return getObjectInstance().isSet(2719745ul, opflex::modb::PropertyInfo::STRING);
48 boost::optional<const std::string&>
getIp()
51 return getObjectInstance().getString(2719745ul);
60 const std::string&
getIp(
const std::string& defaultValue)
62 return getIp().get_value_or(defaultValue);
75 getTLMutator().modify(getClassId(), getURI())->setString(2719745ul, newValue);
87 getTLMutator().modify(getClassId(), getURI())->unset(2719745ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
102 static boost::optional<boost::shared_ptr<modelgbp::epr::L3Net> >
resolve(
103 opflex::ofcore::OFFramework& framework,
104 const opflex::modb::URI& uri)
106 return opflex::modb::mointernal::MO::resolve<modelgbp::epr::L3Net>(framework,
CLASS_ID, uri);
120 static boost::optional<boost::shared_ptr<modelgbp::epr::L3Net> >
resolve(
121 const opflex::modb::URI& uri)
123 return opflex::modb::mointernal::MO::resolve<modelgbp::epr::L3Net>(opflex::ofcore::OFFramework::defaultInstance(),
CLASS_ID, uri);
146 static boost::optional<boost::shared_ptr<modelgbp::epr::L3Net> >
resolve(
147 opflex::ofcore::OFFramework& framework,
148 const std::string& eprL2EpContext,
149 const opflex::modb::MAC& eprL2EpMac,
150 const std::string& eprL3NetIp)
152 return resolve(framework,opflex::modb::URIBuilder().addElement(
"EprL2Universe").addElement(
"EprL2Ep").addElement(eprL2EpContext).addElement(eprL2EpMac).addElement(
"EprL3Net").addElement(eprL3NetIp).build());
174 static boost::optional<boost::shared_ptr<modelgbp::epr::L3Net> >
resolve(
175 const std::string& eprL2EpContext,
176 const opflex::modb::MAC& eprL2EpMac,
177 const std::string& eprL3NetIp)
179 return resolve(opflex::ofcore::OFFramework::defaultInstance(),eprL2EpContext,eprL2EpMac,eprL3NetIp);
194 const std::string& gbpeAttestationName)
212 const std::string& gbpeAttestationName)
214 boost::shared_ptr<modelgbp::gbpe::Attestation> result = addChild<modelgbp::gbpe::Attestation>(
215 CLASS_ID, getURI(), 2150203428ul, 36,
216 opflex::modb::URIBuilder(getURI()).addElement(
"GbpeAttestation").addElement(gbpeAttestationName).build()
218 result->setName(gbpeAttestationName);
238 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbpe::Attestation>(
239 getFramework(),
CLASS_ID, getURI(), 2150203428ul, 36, out);
252 getTLMutator().remove(
CLASS_ID, getURI());
265 static void remove(opflex::ofcore::OFFramework& framework,
266 const opflex::modb::URI& uri)
268 MO::remove(framework,
CLASS_ID, uri);
281 static void remove(
const opflex::modb::URI& uri)
283 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
305 opflex::ofcore::OFFramework& framework,
306 const std::string& eprL2EpContext,
307 const opflex::modb::MAC& eprL2EpMac,
308 const std::string& eprL3NetIp)
310 MO::remove(framework,
CLASS_ID, opflex::modb::URIBuilder().addElement(
"EprL2Universe").addElement(
"EprL2Ep").addElement(eprL2EpContext).addElement(eprL2EpMac).addElement(
"EprL3Net").addElement(eprL3NetIp).build());
332 const std::string& eprL2EpContext,
333 const opflex::modb::MAC& eprL2EpMac,
334 const std::string& eprL3NetIp)
336 remove(opflex::ofcore::OFFramework::defaultInstance(),eprL2EpContext,eprL2EpMac,eprL3NetIp);
351 opflex::ofcore::OFFramework& framework,
352 opflex::modb::ObjectListener* listener)
354 opflex::modb::mointernal
355 ::MO::registerListener(framework, listener,
CLASS_ID);
370 opflex::modb::ObjectListener* listener)
382 opflex::ofcore::OFFramework& framework,
383 opflex::modb::ObjectListener* listener)
385 opflex::modb::mointernal
386 ::MO::unregisterListener(framework, listener,
CLASS_ID);
396 opflex::modb::ObjectListener* listener)
406 opflex::ofcore::OFFramework& framework,
407 const opflex::modb::URI& uri,
408 const boost::shared_ptr<const opflex::modb::mointernal::ObjectInstance>& oi)
409 : MO(framework,
CLASS_ID, uri, oi) { }
414 #endif // GI_EPR_L3NET_HPP
static boost::optional< boost::shared_ptr< modelgbp::epr::L3Net > > resolve(opflex::ofcore::OFFramework &framework, const std::string &eprL2EpContext, const opflex::modb::MAC &eprL2EpMac, const std::string &eprL3NetIp)
Retrieve an instance of L3Net from the managed object store by constructing its URI from the path ele...
Definition: L3Net.hpp:146
void resolveGbpeAttestation(std::vector< boost::shared_ptr< modelgbp::gbpe::Attestation > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbpe::Attestation.
Definition: L3Net.hpp:236
const std::string & getIp(const std::string &defaultValue)
Get the value of ip if set, otherwise the value of default passed in.
Definition: L3Net.hpp:60
static boost::optional< boost::shared_ptr< modelgbp::epr::L3Net > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of L3Net from the managed object store.
Definition: L3Net.hpp:102
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for L3Net.
Definition: L3Net.hpp:33
modelgbp::epr::L3Net & setIp(const std::string &newValue)
Set ip to the specified value in the currently-active mutator.
Definition: L3Net.hpp:73
static boost::optional< boost::shared_ptr< modelgbp::gbpe::Attestation > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Attestation from the managed object store.
Definition: Attestation.hpp:210
boost::optional< const std::string & > getIp()
Get the value of ip if it has been set.
Definition: L3Net.hpp:48
bool isIpSet()
Check whether ip has been set.
Definition: L3Net.hpp:39
boost::shared_ptr< modelgbp::gbpe::Attestation > addGbpeAttestation(const std::string &gbpeAttestationName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: L3Net.hpp:211
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: L3Net.hpp:350
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: L3Net.hpp:369
static boost::optional< boost::shared_ptr< modelgbp::epr::L3Net > > resolve(const std::string &eprL2EpContext, const opflex::modb::MAC &eprL2EpMac, const std::string &eprL3NetIp)
Retrieve an instance of L3Net from the default managed object store by constructing its URI from the ...
Definition: L3Net.hpp:174
modelgbp::epr::L3Net & unsetIp()
Unset ip in the currently-active mutator.
Definition: L3Net.hpp:85
static boost::optional< boost::shared_ptr< modelgbp::epr::L3Net > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of L3Net from the managed object store using the default framework instance...
Definition: L3Net.hpp:120
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: L3Net.hpp:395
boost::optional< boost::shared_ptr< modelgbp::gbpe::Attestation > > resolveGbpeAttestation(const std::string &gbpeAttestationName)
Retrieve the child object with the specified naming properties.
Definition: L3Net.hpp:193
L3Net(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const boost::shared_ptr< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of L3Net.
Definition: L3Net.hpp:405
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: L3Net.hpp:381