CYCLUS
commodity_producer_manager.h
Go to the documentation of this file.
1 #ifndef CYCLUS_SRC_TOOLKIT_COMMODITY_PRODUCER_MANAGER_H_
2 #define CYCLUS_SRC_TOOLKIT_COMMODITY_PRODUCER_MANAGER_H_
3 
4 #include <set>
5 
6 #include "agent_managed.h"
7 #include "commodity.h"
8 #include "commodity_producer.h"
9 
10 namespace cyclus {
11 namespace toolkit {
12 
13 /// A mixin to provide information about commodity producers
15  public:
18 
19  /// @return the total production capacity for a commodity amongst producers
20  /// @param commodity the commodity in question
21  double TotalCapacity(Commodity& commodity);
22 
23  /// Register a commodity producer with the manager
24  /// @param producer the producer
25  inline void Register(CommodityProducer* producer) {
26  producers_.insert(producer);
27  }
28 
29  /// Unregister a commodity producer with the manager
30  /// @param producer the producer
31  inline void Unregister(CommodityProducer* producer) {
32  producers_.erase(producer);
33  }
34 
35  inline const std::set<CommodityProducer*>& producers() const {
36  return producers_;
37  }
38 
39  private:
40  /// The set of managed producers
41  std::set<CommodityProducer*> producers_;
42 };
43 
44 } // namespace toolkit
45 } // namespace cyclus
46 
47 #endif // CYCLUS_SRC_TOOLKIT_COMMODITY_PRODUCER_MANAGER_H_
A simple class defining a commodity; it is currently super simple.
Definition: commodity.h:12
This is a mixin class that provides an interface to access the underlying agent that manages it...
Definition: agent_managed.h:11
void Unregister(CommodityProducer *producer)
Unregister a commodity producer with the manager.
A mixin to provide information about commodity producers.
void Register(CommodityProducer *producer)
Register a commodity producer with the manager.
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.
const std::set< CommodityProducer * > & producers() const