32 #include "trm/Activity.h"
48 const Enum<Activity> Activity::kNone (MAKE_PAIR(None));
49 const Enum<Activity> Activity::kLive (MAKE_PAIR(Live));
50 const Enum<Activity> Activity::kRecord (MAKE_PAIR(Record));
51 const Enum<Activity> Activity::kEAS (MAKE_PAIR(EAS));
53 const std::vector<const Enum<Activity> * > & Activity::getEnums(
void)
55 static std::vector<const Enum<Activity> * > enums_;
56 if (enums_.size() == 0) {
57 enums_.push_back(&Activity::kNone);
58 enums_.push_back(&Activity::kLive);
59 enums_.push_back(&Activity::kRecord);
60 enums_.push_back(&Activity::kEAS);
62 Assert(enums_.size() == MAX_ENUM_NUMBER);
69 Activity::Activity(
const Enum<Activity> &activity)
74 Activity::Activity(
const char *name)
75 : activity(Enum<Activity>::at(name))
79 Activity::~Activity(
void)
103 return details.size() != 0;
116 static const std::string emptyDetail =
"";
117 std::map<KeyT,ValT>::const_iterator it = details.find(key);
118 if (it != details.end()) {
126 const std::map<Activity::KeyT,Activity::ValT> & Activity::getDetails(
void)
const
149 details.insert(std::pair<KeyT,ValT>(key,value));
152 bool Activity::operator == (
const Activity &that)
const
154 return (this->activity == that.activity);
169 for (std::map<KeyT,ValT>::const_iterator it=details.begin(); it!=details.end(); ++it) {
170 std::cout <<
"[OBJ][" << klassName() <<
"][Details] " << it->first <<
" => " << it->second <<
'\n';