Changeset 15168


Ignore:
Timestamp:
03/27/13 16:23:11 (9 years ago)
Author:
tbretz
Message:
Store a global set of all described services.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/DimDescriptionService.cc

    r13257 r15168  
    4444int         DimDescriptionService::fCount   = 0;
    4545std::string DimDescriptionService::fData    = "";
     46
     47set<string> DimDescribedService::fServices;
    4648
    4749// --------------------------------------------------------------------------
  • trunk/FACT++/src/DimDescriptionService.h

    r14488 r15168  
    22#define FACT_DimDescriptionService
    33
     4#include <set>
    45#include <array>
    56#include <string>
     
    2829class DimDescribedService : public DimDescriptionService, public DimService
    2930{
     31    static std::set<std::string> fServices;
     32
    3033public:
    3134    template<typename T>
     
    3336        : DimDescriptionService(name.c_str(), desc), DimService(name.c_str(), const_cast<T&>(val))
    3437    {
     38        fServices.insert(getName());
    3539        setQuality(0);
    3640    }
     
    4044        : DimDescriptionService(name.c_str(), desc), DimService(name.c_str(), format, const_cast<T*>(&val), sizeof(T))
    4145    {
     46        fServices.insert(getName());
    4247        setQuality(0);
    4348    }
     
    4651       : DimDescriptionService(name.c_str(), desc), DimService(name.c_str(), format, (void*)NULL, 0)
    4752    {
     53        fServices.insert(getName());
    4854        setQuality(0);
    4955        // FIXME: compare number of ; with number of |
    5056    }
     57
     58    ~DimDescribedService()
     59    {
     60        fServices.erase(getName());
     61    }
     62
     63    static const std::set<std::string> &GetServices() { return fServices; }
    5164
    5265    void setData(const void *ptr, size_t sz)
Note: See TracChangeset for help on using the changeset viewer.