Changeset 1184 for code/branches/network3/src/network/Client.cc
- Timestamp:
- Apr 24, 2008, 11:00:30 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network3/src/network/Client.cc
r1168 r1184 44 44 namespace network 45 45 { 46 Client* Client::_sClient = 0; 47 48 Client* Client::createSingleton(){ 49 if(!_sClient) 50 _sClient = new Client(); 51 return _sClient; 52 } 53 54 Client* Client::createSingleton(std::string address, int port){ 55 if(!_sClient) 56 _sClient = new Client(address, port); 57 return _sClient; 58 } 59 60 Client* Client::createSingleton(const char *address, int port){ 61 if(!_sClient) 62 _sClient = new Client(address, port); 63 return _sClient; 64 } 65 66 void Client::destroySingleton(){ 67 if(_sClient){ 68 delete _sClient; 69 _sClient = 0; 70 } 71 } 72 73 Client* Client::getSingleton(){ 74 return _sClient; 75 } 76 46 77 /** 47 78 * Constructor for the Client class … … 71 102 } 72 103 104 Client::~Client(){ 105 if(isConnected) 106 closeConnection(); 107 } 108 73 109 /** 74 110 * Establish the Connection to the Server
Note: See TracChangeset
for help on using the changeset viewer.