50 #ifndef _DESCRIPTORSWITCH_H_
51 #define _DESCRIPTORSWITCH_H_
53 #include "../Entity.h"
54 using namespace ::br::pucrio::telemidia::ncl;
56 #include "../descriptor/GenericDescriptor.h"
57 using namespace ::br::pucrio::telemidia::ncl::descriptor;
77 vector<GenericDescriptor*>* descriptorList;
78 vector<Rule*>* ruleList;
79 GenericDescriptor* defaultDescriptor;
80 GenericDescriptor* selectedDescriptor;
82 static set<DescriptorSwitch*> objects;
83 static bool initMutex;
84 static pthread_mutex_t _objMutex;
93 static bool hasInstance(
98 GenericDescriptor* descriptor,
101 bool addDescriptor(GenericDescriptor* descriptor,
Rule* rule);
102 bool containsRule(
Rule* rule);
103 void exchangeDescriptorsAndRules(
105 unsigned int index2);
107 int indexOfRule(
Rule *rule);
108 GenericDescriptor* getDefaultDescriptor();
109 unsigned int indexOfDescriptor(GenericDescriptor* descriptor);
110 GenericDescriptor* getDescriptor(
unsigned int index);
111 GenericDescriptor* getDescriptor(
string descriptorId);
112 GenericDescriptor* getDescriptor(
Rule* rule);
113 Rule* getRule(
unsigned int index);
114 unsigned int getNumDescriptors();
115 unsigned int getNumRules();
116 bool removeDescriptor(
unsigned int index);
117 bool removeDescriptor(GenericDescriptor* descriptor);
118 bool removeRule(
Rule *rule);
119 void setDefaultDescriptor(GenericDescriptor* descriptor);
120 void select(GenericDescriptor* descriptor);
121 void selectDefault();
122 GenericDescriptor* getSelectedDescriptor();
130 #endif //_DESCRIPTORSWITCH_H_
Definition: DescriptorSwitch.h:75