CYCLUS
builder.h
Go to the documentation of this file.
1 #ifndef CYCLUS_SRC_TOOLKIT_BUILDER_H_
2 #define CYCLUS_SRC_TOOLKIT_BUILDER_H_
3 
4 #include <set>
5 
6 #include "agent_managed.h"
7 #include "commodity_producer.h"
8 
9 namespace cyclus {
10 namespace toolkit {
11 
12 /// A mixin to provide information about commodity producers that can
13 /// be built.
14 class Builder : public AgentManaged {
15  public:
17  virtual ~Builder() {}
18 
19  /// Register a commodity producer with the agent
20  /// @param producer the producer
21  inline void Register(CommodityProducer* producer) {
22  producers_.insert(producer);
23  }
24 
25  /// Unregister a commodity producer with the agent
26  /// @param producer the producer
27  inline void Unregister(CommodityProducer* producer) {
28  producers_.erase(producer);
29  }
30 
31  inline const std::set<CommodityProducer*>& producers() const {
32  return producers_;
33  }
34 
35  private:
36  std::set<CommodityProducer*> producers_;
37 };
38 
39 } // namespace toolkit
40 } // namespace cyclus
41 
42 #endif // CYCLUS_SRC_TOOLKIT_BUILDER_H_
This is a mixin class that provides an interface to access the underlying agent that manages it...
Definition: agent_managed.h:11
void Register(CommodityProducer *producer)
Register a commodity producer with the agent.
Definition: builder.h:21
const std::set< CommodityProducer * > & producers() const
Definition: builder.h:31
void Unregister(CommodityProducer *producer)
Unregister a commodity producer with the agent.
Definition: builder.h:27
A mixin to provide information about commodity producers that can be built.
Definition: builder.h:14
The abstract base class used by all types of agents that live and interact in a simulation.
Definition: agent.h:51
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or.org/Osi/browser/trunk.
Definition: agent.cc:14
A mixin to provide information about produced commodities.
Builder(Agent *agent=NULL)
Definition: builder.h:16