modelgbp Generated OpFlex Model  1.7.0
L3Net.hpp
1 
10 #pragma once
11 #ifndef GI_EPR_L3NET_HPP
12 #define GI_EPR_L3NET_HPP
13 
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
17 /*
18  * contains: item:mclass(gbpe/Attestation)
19  */
20 #include "modelgbp/gbpe/Attestation.hpp"
21 
22 namespace modelgbp {
23 namespace epr {
24 
25 class L3Net
26  : public opflex::modb::mointernal::MO
27 {
28 public:
29 
33  static const opflex::modb::class_id_t CLASS_ID = 100;
34 
39  bool isIpSet()
40  {
41  return getObjectInstance().isSet(3276801ul, opflex::modb::PropertyInfo::STRING);
42  }
43 
48  boost::optional<const std::string&> getIp()
49  {
50  if (isIpSet())
51  return getObjectInstance().getString(3276801ul);
52  return boost::none;
53  }
54 
60  const std::string& getIp(const std::string& defaultValue)
61  {
62  return getIp().get_value_or(defaultValue);
63  }
64 
73  modelgbp::epr::L3Net& setIp(const std::string& newValue)
74  {
75  getTLMutator().modify(getClassId(), getURI())->setString(3276801ul, newValue);
76  return *this;
77  }
78 
86  {
87  getTLMutator().modify(getClassId(), getURI())->unset(3276801ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
88  return *this;
89  }
90 
102  static boost::optional<OF_SHARED_PTR<modelgbp::epr::L3Net> > resolve(
103  opflex::ofcore::OFFramework& framework,
104  const opflex::modb::URI& uri)
105  {
106  return opflex::modb::mointernal::MO::resolve<modelgbp::epr::L3Net>(framework, CLASS_ID, uri);
107  }
108 
120  static boost::optional<OF_SHARED_PTR<modelgbp::epr::L3Net> > resolve(
121  const opflex::modb::URI& uri)
122  {
123  return opflex::modb::mointernal::MO::resolve<modelgbp::epr::L3Net>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
124  }
125 
146  static boost::optional<OF_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)
151  {
152  return resolve(framework,opflex::modb::URIBuilder().addElement("EprL2Universe").addElement("EprL2Ep").addElement(eprL2EpContext).addElement(eprL2EpMac).addElement("EprL3Net").addElement(eprL3NetIp).build());
153  }
154 
174  static boost::optional<OF_SHARED_PTR<modelgbp::epr::L3Net> > resolve(
175  const std::string& eprL2EpContext,
176  const opflex::modb::MAC& eprL2EpMac,
177  const std::string& eprL3NetIp)
178  {
179  return resolve(opflex::ofcore::OFFramework::defaultInstance(),eprL2EpContext,eprL2EpMac,eprL3NetIp);
180  }
181 
193  boost::optional<OF_SHARED_PTR<modelgbp::gbpe::Attestation> > resolveGbpeAttestation(
194  const std::string& gbpeAttestationName)
195  {
196  return modelgbp::gbpe::Attestation::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("GbpeAttestation").addElement(gbpeAttestationName).build());
197  }
198 
211  OF_SHARED_PTR<modelgbp::gbpe::Attestation> addGbpeAttestation(
212  const std::string& gbpeAttestationName)
213  {
214  OF_SHARED_PTR<modelgbp::gbpe::Attestation> result = addChild<modelgbp::gbpe::Attestation>(
215  CLASS_ID, getURI(), 2150760495ul, 47,
216  opflex::modb::URIBuilder(getURI()).addElement("GbpeAttestation").addElement(gbpeAttestationName).build()
217  );
218  result->setName(gbpeAttestationName);
219  return result;
220  }
221 
236  void resolveGbpeAttestation(/* out */ std::vector<OF_SHARED_PTR<modelgbp::gbpe::Attestation> >& out)
237  {
238  opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbpe::Attestation>(
239  getFramework(), CLASS_ID, getURI(), 2150760495ul, 47, out);
240  }
241 
250  void remove()
251  {
252  getTLMutator().remove(CLASS_ID, getURI());
253  }
254 
265  static void remove(opflex::ofcore::OFFramework& framework,
266  const opflex::modb::URI& uri)
267  {
268  MO::remove(framework, CLASS_ID, uri);
269  }
270 
281  static void remove(const opflex::modb::URI& uri)
282  {
283  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
284  }
285 
304  static void remove(
305  opflex::ofcore::OFFramework& framework,
306  const std::string& eprL2EpContext,
307  const opflex::modb::MAC& eprL2EpMac,
308  const std::string& eprL3NetIp)
309  {
310  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("EprL2Universe").addElement("EprL2Ep").addElement(eprL2EpContext).addElement(eprL2EpMac).addElement("EprL3Net").addElement(eprL3NetIp).build());
311  }
312 
331  static void remove(
332  const std::string& eprL2EpContext,
333  const opflex::modb::MAC& eprL2EpMac,
334  const std::string& eprL3NetIp)
335  {
336  remove(opflex::ofcore::OFFramework::defaultInstance(),eprL2EpContext,eprL2EpMac,eprL3NetIp);
337  }
338 
350  static void registerListener(
351  opflex::ofcore::OFFramework& framework,
352  opflex::modb::ObjectListener* listener)
353  {
354  opflex::modb::mointernal
355  ::MO::registerListener(framework, listener, CLASS_ID);
356  }
357 
369  static void registerListener(
370  opflex::modb::ObjectListener* listener)
371  {
372  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
373  }
374 
381  static void unregisterListener(
382  opflex::ofcore::OFFramework& framework,
383  opflex::modb::ObjectListener* listener)
384  {
385  opflex::modb::mointernal
386  ::MO::unregisterListener(framework, listener, CLASS_ID);
387  }
388 
395  static void unregisterListener(
396  opflex::modb::ObjectListener* listener)
397  {
398  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
399  }
400 
406  opflex::ofcore::OFFramework& framework,
407  const opflex::modb::URI& uri,
408  const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
409  : MO(framework, CLASS_ID, uri, oi) { }
410 }; // class L3Net
411 
412 } // namespace epr
413 } // namespace modelgbp
414 #endif // GI_EPR_L3NET_HPP
boost::optional< OF_SHARED_PTR< modelgbp::gbpe::Attestation > > resolveGbpeAttestation(const std::string &gbpeAttestationName)
Retrieve the child object with the specified naming properties.
Definition: L3Net.hpp:193
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
OF_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 boost::optional< OF_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
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
boost::optional< const std::string & > getIp()
Get the value of ip if it has been set.
Definition: L3Net.hpp:48
Definition: L3Net.hpp:25
bool isIpSet()
Check whether ip has been set.
Definition: L3Net.hpp:39
static boost::optional< OF_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 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 boost::optional< OF_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 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< OF_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
void resolveGbpeAttestation(std::vector< OF_SHARED_PTR< modelgbp::gbpe::Attestation > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbpe::Attestation.
Definition: L3Net.hpp:236
modelgbp::epr::L3Net & unsetIp()
Unset ip in the currently-active mutator.
Definition: L3Net.hpp:85
L3Net(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of L3Net.
Definition: L3Net.hpp:405
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: L3Net.hpp:395
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: L3Net.hpp:381
static boost::optional< OF_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