1 /* -*- c++ -*- */
2 #ifndef OUTPUTFACTORYDETAILS_H
3 #define OUTPUTFACTORYDETAILS_H
4 
5 #include "Factory.h"
6 
7 #include "Output.h"
8 #include "Value.h"
9 namespace ProtoMol {
10 
11 
12   class OutputFactoryDetails;
13   class OutputCollection;
14 
15   //_____________________________________________________ FactoryTraits<Output>
16   template <>
17   class FactoryTraits<Output> {
18   public:
19     typedef OutputFactoryDetails Details;
20   };
21 
22 
23   //_____________________________________________________ OutputFactoryDetails
24   class OutputFactoryDetails : public FactoryBase <Output> {
25     //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26     // Types
27     //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28   private:
29     typedef Factory<Output> TFactory;
30     //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31     // Constructors, destructors, assignment
32     //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33   protected:
34     OutputFactoryDetails();
35     virtual ~OutputFactoryDetails();
36   private:
37     OutputFactoryDetails(const OutputFactoryDetails&);
38     OutputFactoryDetails& operator=(const OutputFactoryDetails&);
39 
40     //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41     // From FactoryBase<Output>
42     //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43    protected:
44     virtual std::string doPrint()const;
45     virtual void doRegisterHelpText() const;
46 
47     //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48     // New methods of class DetailsOutputFactory
49     //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50   public:
51     static void registerAllExemplarsConfiguration(Configuration* config);
52     static Output* make(std::string& errMsg, const std::string& id, const std::vector<Value>& values);
53     static OutputCollection* makeCollection(std::string& errMsg, const Configuration* config);
54   private:
55     void doRegisterAllExemplarsConfiguration(Configuration* config) const;
56     Output* doMake(std::string& errMsg, const std::string& id, const std::vector<Value>& values) const;
57     OutputCollection* doMakeCollection(std::string& errMsg, const Configuration* config) const;
58 
59 
60     //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61     // private data members
62     //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63   };
64 
65 
66 }
67 #endif /* OUTPUTFACTORYDETAILS_H */
68