00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "stdafx.h"
00024 #include "Entry.h"
00025
00026 int Entry::counter = 1;
00027
00028 Entry::Entry()
00029 :_name("Invalid"), _app(NULL), _id(-1), _state(UNKNOWN)
00030 {
00031 }
00032
00033 Entry::Entry(const Entry &e)
00034 :_name(e._name), _app(e._app), _id(e._id), _state(e._state)
00035 {
00036 }
00037
00038 Entry::Entry(const string &name, const AgentState &state)
00039 :_name(name), _app(NULL), _state(state), _id(counter++)
00040 {
00041 }
00042
00043 Entry::~Entry()
00044 {
00045 }
00046
00047 int Entry::getId() const
00048 {
00049 return _id;
00050 }
00051
00052 string Entry::getName() const
00053 {
00054 return _name;
00055 }
00056
00057 AgentState Entry::getState() const
00058 {
00059 return _state;
00060 }
00061
00062 void Entry::setApp(MicoleBus *app)
00063 {
00064 _app = app;
00065 }
00066
00067 Entry &Entry::operator =(const Entry &e)
00068 {
00069 _name = e._name;
00070 _app = e._app;
00071 _id = e._id;
00072 _state = e._state;
00073 return *this;
00074 }