mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
add an overloaded << operator to simplify address debugging
This commit is contained in:
parent
bd02f48943
commit
00211ddc3d
3 changed files with 11 additions and 1 deletions
|
@ -25,6 +25,7 @@ int AgentList::updateList(char *packetData) {
|
|||
agentLocalSocket.address,
|
||||
&agentLocalSocket.port
|
||||
))) {
|
||||
|
||||
std::vector<Agent>::iterator it;
|
||||
|
||||
for(it = agents.begin(); it != agents.end(); ++it) {
|
||||
|
|
|
@ -34,4 +34,5 @@ void AgentSocket::swap(AgentSocket &first, AgentSocket &second) {
|
|||
|
||||
AgentSocket::~AgentSocket() {
|
||||
delete address;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,10 +17,18 @@ class AgentSocket {
|
|||
AgentSocket(const AgentSocket &otherAgentSocket);
|
||||
AgentSocket& operator=(AgentSocket otherAgentSocket);
|
||||
~AgentSocket();
|
||||
|
||||
|
||||
|
||||
char *address;
|
||||
unsigned short port;
|
||||
private:
|
||||
void swap(AgentSocket &first, AgentSocket &second);
|
||||
};
|
||||
|
||||
inline std::ostream& operator<<(std::ostream & Str, AgentSocket const &socket) {
|
||||
Str << socket.address << ":" << socket.port;
|
||||
return Str;
|
||||
}
|
||||
|
||||
#endif /* defined(__hifi__AgentSocket__) */
|
||||
|
|
Loading…
Reference in a new issue