00001 // Copyright CERN 2012 - Developed in collaboration with GSI 00002 00003 #ifndef EXTENDED_MULTIPLEXING_MANAGER_H_ 00004 #define EXTENDED_MULTIPLEXING_MANAGER_H_ 00005 00006 #include <fesa-core/Synchronization/AbstractMultiplexingManager.h> 00007 00008 #include <vector> 00009 #include <string> 00010 00011 namespace fesa 00012 { 00013 00019 class ExtendedMultiplexingManager : public AbstractMultiplexingManager 00020 { 00021 00022 friend class AbstractField; 00023 template<typename T> friend class Field; 00024 00025 public: 00026 00033 ExtendedMultiplexingManager(const std::string& name, std::vector<std::string> extraCriterionCol, 00034 AbstractMultiplexingManager *baseMultiplexingManager); 00035 00040 int32_t getDepth(); 00041 00047 int32_t requireSlot(MultiplexingContext& context); 00048 00055 int32_t getSlot(MultiplexingContext& context); 00056 00061 const std::vector<std::string>& getExtraCriterionCol(); 00062 00068 AbstractMultiplexingDataManager* getMultiplexingDataManager(); 00069 00070 protected: 00071 00080 int32_t getLastSlot(int32_t cycleId); 00081 00089 int32_t getLastSlot(int32_t cycleId, const std::string& extraCriterion); 00090 00099 int32_t requireSlot(int32_t cycleId); //Not used. To be compliant with base class 00100 00101 00109 int32_t requireSlot(int32_t cycleId, const std::string& extraCriterion); 00110 00119 int32_t getLastSlot(const std::string& cycleName); 00120 00128 int32_t getLastSlot(const std::string& cycleName, const std::string& extraCriterion); 00129 00138 int32_t requireSlot(const std::string& cycleName); //Not used. To be compliant with base class 00139 00140 00148 int32_t requireSlot(const std::string& cycleName, const std::string& extraCriterion); 00149 00156 int32_t getBlockOffset(MultiplexingContext& context); 00157 00162 AbstractMultiplexingManager* baseMultiplexingManager_; 00163 00167 std::vector<std::string> extraCriterionCol_; 00168 }; 00169 00170 inline AbstractMultiplexingDataManager* ExtendedMultiplexingManager::getMultiplexingDataManager() 00171 { 00172 return baseMultiplexingManager_->getMultiplexingDataManager(); 00173 } 00174 00175 inline const std::vector<std::string>& ExtendedMultiplexingManager::getExtraCriterionCol() 00176 { 00177 return extraCriterionCol_; 00178 } 00179 00180 } // fesa 00181 00182 #endif // EXTENDED_MULTIPLEXING_MANAGER_H_