modelgbp Generated OpFlex Model  1.7.0
FloodContext.hpp
1 
10 #pragma once
11 #ifndef GI_GBPE_FLOODCONTEXT_HPP
12 #define GI_GBPE_FLOODCONTEXT_HPP
13 
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
17 
18 namespace modelgbp {
19 namespace gbpe {
20 
22  : public opflex::modb::mointernal::MO
23 {
24 public:
25 
29  static const opflex::modb::class_id_t CLASS_ID = 41;
30 
36  {
37  return getObjectInstance().isSet(1343489ul, opflex::modb::PropertyInfo::STRING);
38  }
39 
44  boost::optional<const std::string&> getMulticastGroupIP()
45  {
47  return getObjectInstance().getString(1343489ul);
48  return boost::none;
49  }
50 
56  const std::string& getMulticastGroupIP(const std::string& defaultValue)
57  {
58  return getMulticastGroupIP().get_value_or(defaultValue);
59  }
60 
69  modelgbp::gbpe::FloodContext& setMulticastGroupIP(const std::string& newValue)
70  {
71  getTLMutator().modify(getClassId(), getURI())->setString(1343489ul, newValue);
72  return *this;
73  }
74 
82  {
83  getTLMutator().modify(getClassId(), getURI())->unset(1343489ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
84  return *this;
85  }
86 
98  static boost::optional<OF_SHARED_PTR<modelgbp::gbpe::FloodContext> > resolve(
99  opflex::ofcore::OFFramework& framework,
100  const opflex::modb::URI& uri)
101  {
102  return opflex::modb::mointernal::MO::resolve<modelgbp::gbpe::FloodContext>(framework, CLASS_ID, uri);
103  }
104 
116  static boost::optional<OF_SHARED_PTR<modelgbp::gbpe::FloodContext> > resolve(
117  const opflex::modb::URI& uri)
118  {
119  return opflex::modb::mointernal::MO::resolve<modelgbp::gbpe::FloodContext>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
120  }
121 
140  static boost::optional<OF_SHARED_PTR<modelgbp::gbpe::FloodContext> > resolve(
141  opflex::ofcore::OFFramework& framework,
142  const std::string& policySpaceName,
143  const std::string& gbpFloodDomainName)
144  {
145  return resolve(framework,opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpFloodDomain").addElement(gbpFloodDomainName).addElement("GbpeFloodContext").build());
146  }
147 
165  static boost::optional<OF_SHARED_PTR<modelgbp::gbpe::FloodContext> > resolve(
166  const std::string& policySpaceName,
167  const std::string& gbpFloodDomainName)
168  {
169  return resolve(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpFloodDomainName);
170  }
171 
180  void remove()
181  {
182  getTLMutator().remove(CLASS_ID, getURI());
183  }
184 
195  static void remove(opflex::ofcore::OFFramework& framework,
196  const opflex::modb::URI& uri)
197  {
198  MO::remove(framework, CLASS_ID, uri);
199  }
200 
211  static void remove(const opflex::modb::URI& uri)
212  {
213  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
214  }
215 
232  static void remove(
233  opflex::ofcore::OFFramework& framework,
234  const std::string& policySpaceName,
235  const std::string& gbpFloodDomainName)
236  {
237  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpFloodDomain").addElement(gbpFloodDomainName).addElement("GbpeFloodContext").build());
238  }
239 
256  static void remove(
257  const std::string& policySpaceName,
258  const std::string& gbpFloodDomainName)
259  {
260  remove(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpFloodDomainName);
261  }
262 
274  static void registerListener(
275  opflex::ofcore::OFFramework& framework,
276  opflex::modb::ObjectListener* listener)
277  {
278  opflex::modb::mointernal
279  ::MO::registerListener(framework, listener, CLASS_ID);
280  }
281 
293  static void registerListener(
294  opflex::modb::ObjectListener* listener)
295  {
296  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
297  }
298 
305  static void unregisterListener(
306  opflex::ofcore::OFFramework& framework,
307  opflex::modb::ObjectListener* listener)
308  {
309  opflex::modb::mointernal
310  ::MO::unregisterListener(framework, listener, CLASS_ID);
311  }
312 
319  static void unregisterListener(
320  opflex::modb::ObjectListener* listener)
321  {
322  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
323  }
324 
330  opflex::ofcore::OFFramework& framework,
331  const opflex::modb::URI& uri,
332  const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
333  : MO(framework, CLASS_ID, uri, oi) { }
334 }; // class FloodContext
335 
336 } // namespace gbpe
337 } // namespace modelgbp
338 #endif // GI_GBPE_FLOODCONTEXT_HPP
bool isMulticastGroupIPSet()
Check whether multicastGroupIP has been set.
Definition: FloodContext.hpp:35
static boost::optional< OF_SHARED_PTR< modelgbp::gbpe::FloodContext > > resolve(const std::string &policySpaceName, const std::string &gbpFloodDomainName)
Retrieve an instance of FloodContext from the default managed object store by constructing its URI fr...
Definition: FloodContext.hpp:165
static boost::optional< OF_SHARED_PTR< modelgbp::gbpe::FloodContext > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of FloodContext from the managed object store using the default framework instan...
Definition: FloodContext.hpp:116
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for FloodContext.
Definition: FloodContext.hpp:29
static boost::optional< OF_SHARED_PTR< modelgbp::gbpe::FloodContext > > resolve(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpFloodDomainName)
Retrieve an instance of FloodContext from the managed object store by constructing its URI from the p...
Definition: FloodContext.hpp:140
boost::optional< const std::string & > getMulticastGroupIP()
Get the value of multicastGroupIP if it has been set.
Definition: FloodContext.hpp:44
static boost::optional< OF_SHARED_PTR< modelgbp::gbpe::FloodContext > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of FloodContext from the managed object store.
Definition: FloodContext.hpp:98
modelgbp::gbpe::FloodContext & unsetMulticastGroupIP()
Unset multicastGroupIP in the currently-active mutator.
Definition: FloodContext.hpp:81
modelgbp::gbpe::FloodContext & setMulticastGroupIP(const std::string &newValue)
Set multicastGroupIP to the specified value in the currently-active mutator.
Definition: FloodContext.hpp:69
FloodContext(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of FloodContext.
Definition: FloodContext.hpp:329
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: FloodContext.hpp:319
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: FloodContext.hpp:305
const std::string & getMulticastGroupIP(const std::string &defaultValue)
Get the value of multicastGroupIP if set, otherwise the value of default passed in.
Definition: FloodContext.hpp:56
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: FloodContext.hpp:293
Definition: FloodContext.hpp:21
SOME COPYRIGHT.
Definition: OpcodeEnumT.hpp:12
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: FloodContext.hpp:274