GAMS  1.2.2
AuctionFactoryRepository.h
Go to the documentation of this file.
1 
54 #ifndef _GAMS_AUCTIONS_AUCTION_FACTORY_REPOSITORY_H_
55 #define _GAMS_AUCTIONS_AUCTION_FACTORY_REPOSITORY_H_
56 
57 #include <vector>
58 #include <string>
59 #include <map>
60 
61 #include "madara/knowledge/KnowledgeBase.h"
62 #include "AuctionFactory.h"
63 
64 namespace gams
65 {
66  namespace auctions
67  {
71  typedef std::map <AuctionType, AuctionFactory *> AuctionFactoryMap;
72 
77  {
78  public:
85  const std::string & agent_prefix,
86  madara::knowledge::KnowledgeBase * knowledge = 0);
87 
91  virtual ~AuctionFactoryRepository ();
92 
99  void add (AuctionType type,
100  AuctionFactory * factory);
101 
107  AuctionBase * create (const std::string & auction_prefix);
108 
114  AuctionBase * create (AuctionType type);
115 
120  void set_knowledge (madara::knowledge::KnowledgeBase * knowledge);
121 
126  void set_agent_prefix (const std::string & prefix);
127 
128  protected:
129 
133  void init (void);
134 
136  madara::knowledge::KnowledgeBase * knowledge_;
137 
141  std::string agent_prefix_;
142 
144  AuctionFactoryMap factory_map_;
145 
146  };
147  }
148 }
149 
150 #include "AuctionFactoryRepository.inl"
151 
152 #endif // _GAMS_AUCTIONS_AUCTION_FACTORY_REPOSITORY_H_
Base class for an auction factory.
madara::knowledge::KnowledgeBase * knowledge_
knowledge base containing variables
std::string agent_prefix_
self prefix of the agent
Copyright (c) 2016 Carnegie Mellon University.
Base class for an auction.
Definition: AuctionBase.h:78
A repository for auction factories.
Contains all GAMS-related tools, classes and code.
#define GAMS_EXPORT
Definition: GamsExport.h:20
std::map< AuctionType, AuctionFactory * > AuctionFactoryMap
Convenience typedef for a map of types to factories.
AuctionFactoryMap factory_map_
a mapping of types to auction factories
madara::knowledge::KnowledgeRecord::Integer AuctionType
convenience typedef for AuctionType