mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
type squishes in Agent class
This commit is contained in:
parent
12b4b485f0
commit
80284470ed
2 changed files with 6 additions and 6 deletions
|
@ -22,17 +22,17 @@
|
|||
|
||||
using shared_lib::printLog;
|
||||
|
||||
int unpackAgentId(unsigned char *packedData, uint16_t *agentId) {
|
||||
int unpackAgentId(unsigned char* packedData, uint16_t* agentId) {
|
||||
memcpy(agentId, packedData, sizeof(uint16_t));
|
||||
return sizeof(uint16_t);
|
||||
}
|
||||
|
||||
int packAgentId(unsigned char *packStore, uint16_t agentId) {
|
||||
int packAgentId(unsigned char* packStore, uint16_t agentId) {
|
||||
memcpy(packStore, &agentId, sizeof(uint16_t));
|
||||
return sizeof(uint16_t);
|
||||
}
|
||||
|
||||
Agent::Agent(sockaddr *publicSocket, sockaddr *localSocket, char type, uint16_t agentID) :
|
||||
Agent::Agent(sockaddr* publicSocket, sockaddr* localSocket, char type, uint16_t agentID) :
|
||||
_type(type),
|
||||
_agentID(agentID),
|
||||
_wakeMicrostamp(usecTimestampNow()),
|
||||
|
@ -61,7 +61,7 @@ Agent::Agent(const Agent &otherAgent) :
|
|||
_wakeMicrostamp(otherAgent._wakeMicrostamp),
|
||||
_lastHeardMicrostamp(otherAgent._lastHeardMicrostamp),
|
||||
_isAlive(otherAgent._isAlive)
|
||||
{
|
||||
{
|
||||
if (otherAgent._publicSocket) {
|
||||
_publicSocket = new sockaddr(*otherAgent._localSocket);
|
||||
} else {
|
||||
|
|
|
@ -23,13 +23,13 @@
|
|||
|
||||
class Agent {
|
||||
public:
|
||||
Agent(sockaddr *publicSocket, sockaddr *localSocket, char type, uint16_t agentID);
|
||||
Agent(sockaddr* publicSocket, sockaddr* localSocket, char type, uint16_t agentID);
|
||||
Agent(const Agent &otherAgent);
|
||||
~Agent();
|
||||
Agent& operator=(Agent otherAgent);
|
||||
bool operator==(const Agent& otherAgent);
|
||||
|
||||
bool matches(sockaddr *otherPublicSocket, sockaddr *otherLocalSocket, char otherAgentType);
|
||||
bool matches(sockaddr* otherPublicSocket, sockaddr* otherLocalSocket, char otherAgentType);
|
||||
|
||||
char getType() const { return _type; }
|
||||
void setType(char type) { _type = type; }
|
||||
|
|
Loading…
Reference in a new issue