add _ownerID member variable to AgentList

This commit is contained in:
Stephen Birarda 2013-05-07 11:16:05 -07:00
parent 589e524090
commit 43a3775633
2 changed files with 9 additions and 7 deletions

View file

@ -62,8 +62,9 @@ AgentList::AgentList(char newOwnerType, unsigned int newSocketListenPort) :
_agentBuckets(),
_numAgents(0),
agentSocket(newSocketListenPort),
ownerType(newOwnerType),
_ownerType(newOwnerType),
socketListenPort(newSocketListenPort),
_ownerID(-1),
lastAgentId(0) {
pthread_mutex_init(&mutex, 0);
}
@ -81,10 +82,6 @@ UDPSocket& AgentList::getAgentSocket() {
return agentSocket;
}
char AgentList::getOwnerType() {
return ownerType;
}
unsigned int AgentList::getSocketListenPort() {
return socketListenPort;
}

View file

@ -70,9 +70,13 @@ public:
int updateAgentWithData(Agent *agent, unsigned char *packetData, int dataBytes);
void broadcastToAgents(unsigned char *broadcastData, size_t dataBytes, const char* agentTypes, int numAgentTypes);
char getOwnerType();
unsigned int getSocketListenPort();
char getOwnerType() const { return _ownerType; }
uint16_t getOwnerID() const { return _ownerID; }
void setOwnerID(uint16_t ownerID) { _ownerID = ownerID; }
Agent* soloAgentOfType(char agentType);
void startSilentAgentRemovalThread();
@ -96,8 +100,9 @@ private:
Agent** _agentBuckets[MAX_NUM_AGENTS / AGENTS_PER_BUCKET];
int _numAgents;
UDPSocket agentSocket;
char ownerType;
char _ownerType;
unsigned int socketListenPort;
uint16_t _ownerID;
uint16_t lastAgentId;
pthread_t removeSilentAgentsThread;
pthread_t checkInWithDomainServerThread;