| 1 | #ifndef FACT_DimDescriptionService
|
|---|
| 2 | #define FACT_DimDescriptionService
|
|---|
| 3 |
|
|---|
| 4 | #include <string>
|
|---|
| 5 |
|
|---|
| 6 | class DimService;
|
|---|
| 7 |
|
|---|
| 8 | class DimDescriptionService
|
|---|
| 9 | {
|
|---|
| 10 | static int fCount; /// Counter to count the number of instatiations
|
|---|
| 11 | static DimService *fService; /// Pointer to the DimService distributing the desscriptions
|
|---|
| 12 | static std::string fData; /// Data to be distributed with the service
|
|---|
| 13 |
|
|---|
| 14 | std::string fDescription; /// Local storage for the applied description
|
|---|
| 15 |
|
|---|
| 16 | public:
|
|---|
| 17 | DimDescriptionService(const std::string &name, const std::string &format);
|
|---|
| 18 | ~DimDescriptionService();
|
|---|
| 19 |
|
|---|
| 20 | std::string GetDescription() const { return fDescription; }
|
|---|
| 21 | };
|
|---|
| 22 |
|
|---|
| 23 | #include "dis.hxx"
|
|---|
| 24 |
|
|---|
| 25 | class DimDescribedService : public DimDescriptionService, public DimService
|
|---|
| 26 | {
|
|---|
| 27 | public:
|
|---|
| 28 | template<typename T>
|
|---|
| 29 | DimDescribedService(const char *name, T &val, const char *desc)
|
|---|
| 30 | : DimDescriptionService(name, desc), DimService(name, val)
|
|---|
| 31 | {
|
|---|
| 32 | }
|
|---|
| 33 |
|
|---|
| 34 | DimDescribedService(const char *name, const char *val, const char *desc)
|
|---|
| 35 | : DimDescriptionService(name, desc), DimService(name, const_cast<char*>(val)) { }
|
|---|
| 36 |
|
|---|
| 37 | DimDescribedService(const char *name, const char *format, void *structure, int size, const char *desc)
|
|---|
| 38 | : DimDescriptionService(name, desc), DimService(name, format, structure, size)
|
|---|
| 39 | {
|
|---|
| 40 | // FIXME: compare number of ; with number of |
|
|---|
| 41 | }
|
|---|
| 42 | };
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 | #endif
|
|---|