diff --git a/CumulusLib/sources/AMFWriter.cpp b/CumulusLib/sources/AMFWriter.cpp index 2ed835a..8eff905 100644 --- a/CumulusLib/sources/AMFWriter.cpp +++ b/CumulusLib/sources/AMFWriter.cpp @@ -81,7 +81,8 @@ void AMFWriter::writePropertyName(const string& value) { void AMFWriter::writeString(const string& value) { if(!value.empty()) { - map::iterator it = _stringReferences.lower_bound(value); + std::map::iterator it = +_stringReferences.lower_bound(value); if(it!=_stringReferences.end() && it->first==value) { writer.write7BitValue(it->second<<1); return; diff --git a/CumulusLib/sources/Flow.cpp b/CumulusLib/sources/Flow.cpp index e7f399e..3671be6 100644 --- a/CumulusLib/sources/Flow.cpp +++ b/CumulusLib/sources/Flow.cpp @@ -92,7 +92,7 @@ void Flow::complete() { DEBUG("Flow %s consumed",NumberFormatter::format(id).c_str()); // delete fragments - map::const_iterator it; + std::map::const_iterator it; for(it=_fragments.begin();it!=_fragments.end();++it) delete it->second; _fragments.clear(); @@ -150,7 +150,8 @@ void Flow::commit() { list lost; UInt64 current=stage; UInt32 count=0; - map::const_iterator it=_fragments.begin(); + std::map::const_iterator +it=_fragments.begin(); while(it!=_fragments.end()) { current = it->first-current-2; size += Util::Get7BitValueSize(current); @@ -201,7 +202,8 @@ void Flow::fragmentHandler(UInt64 stage,UInt64 deltaNAck,PacketReader& fragment, } if(this->stage < (stage-deltaNAck)) { - map::iterator it=_fragments.begin(); + std::map::iterator +it=_fragments.begin(); while(it!=_fragments.end()) { if( it->first > stage) break; @@ -221,7 +223,8 @@ void Flow::fragmentHandler(UInt64 stage,UInt64 deltaNAck,PacketReader& fragment, if(stage>nextStage) { // not following stage, bufferizes the stage - map::iterator it = _fragments.lower_bound(stage); + std::map::iterator it = +_fragments.lower_bound(stage); if(it==_fragments.end() || it->first!=stage) { if(it!=_fragments.begin()) --it; @@ -234,7 +237,8 @@ void Flow::fragmentHandler(UInt64 stage,UInt64 deltaNAck,PacketReader& fragment, fragmentSortedHandler(nextStage++,fragment,flags); if(flags&MESSAGE_END) complete(); - map::iterator it=_fragments.begin(); + std::map::iterator +it=_fragments.begin(); while(it!=_fragments.end()) { if( it->first > nextStage) break; diff --git a/CumulusLib/sources/FlowWriter.cpp b/CumulusLib/sources/FlowWriter.cpp index ebc8fdc..c05f162 100644 --- a/CumulusLib/sources/FlowWriter.cpp +++ b/CumulusLib/sources/FlowWriter.cpp @@ -146,7 +146,8 @@ void FlowWriter::acknowledgment(PacketReader& reader) { continue; } - map::iterator itFrag=message.fragments.begin(); + std::map::iterator +itFrag=message.fragments.begin(); while(message.fragments.end()!=itFrag) { // ACK @@ -386,7 +387,8 @@ void FlowWriter::raiseMessage() { stop = false; } - map::const_iterator itFrag=message.fragments.begin(); + std::map::const_iterator +itFrag=message.fragments.begin(); UInt32 available; BinaryReader& content = message.reader(available); diff --git a/CumulusLib/sources/Handshake.cpp b/CumulusLib/sources/Handshake.cpp index 6a3ed48..8cea29a 100644 --- a/CumulusLib/sources/Handshake.cpp +++ b/CumulusLib/sources/Handshake.cpp @@ -47,7 +47,8 @@ Handshake::~Handshake() { void Handshake::manage() { // delete obsolete cookie - map::iterator it=_cookies.begin(); + std::map::iterator +it=_cookies.begin(); while(it!=_cookies.end()) { if(it->second->obsolete()) { eraseHelloAttempt(it->second->tag); @@ -60,7 +61,8 @@ void Handshake::manage() { } void Handshake::commitCookie(const UInt8* value) { - map::iterator it = _cookies.find(value); + std::map::iterator it = +_cookies.find(value); if(it==_cookies.end()) { WARN("Cookie %s not found, maybe becoming obsolete before commiting (congestion?)",Util::FormatHex(value,COOKIE_SIZE).c_str()); return; @@ -73,7 +75,8 @@ void Handshake::commitCookie(const UInt8* value) { void Handshake::clear() { // delete cookies - map::const_iterator it; + std::map::const_iterator +it; for(it=_cookies.begin();it!=_cookies.end();++it) { eraseHelloAttempt(it->second->tag); delete it->second; @@ -125,7 +128,8 @@ void Handshake::packetHandler(PacketReader& packet) { } Session* Handshake::createSession(const UInt8* cookieValue) { - map::iterator itCookie = _cookies.find(cookieValue); + std::map::iterator itCookie += _cookies.find(cookieValue); if(itCookie==_cookies.end()) { WARN("Creating session for an unknown cookie '%s' (CPU congestion?)",Util::FormatHex(cookieValue,COOKIE_SIZE).c_str()); return NULL; @@ -135,7 +139,8 @@ Session* Handshake::createSession(const UInt8* cookieValue) { // Fill peer infos memcpy((void*)peer.id,cookie.peerId,ID_SIZE); - Util::UnpackUrl(cookie.queryUrl,(string&)peer.path,(map&)peer.properties); + +Util::UnpackUrl(cookie.queryUrl,(string&)peer.path,(std::map&)peer.properties); (UInt32&)farId = cookie.farId; (SocketAddress&)peer.address = cookie.peerAddress; @@ -190,7 +195,8 @@ UInt8 Handshake::handshakeHandler(UInt8 id,PacketReader& request,PacketWriter& r // Fill peer infos UInt16 port; string host; - Util::UnpackUrl(epd,host,port,(string&)peer.path,(map&)peer.properties); + +Util::UnpackUrl(epd,host,port,(string&)peer.path,(std::map&)peer.properties); set addresses; peer.onHandshake(attempt.count+1,addresses); if(!addresses.empty()) { @@ -226,7 +232,8 @@ UInt8 Handshake::handshakeHandler(UInt8 id,PacketReader& request,PacketWriter& r return 0; } - map::iterator itCookie = _cookies.find(request.current()); + std::map::iterator itCookie = _cookies.find(request.current()); if(itCookie==_cookies.end()) { WARN("Cookie %s unknown, maybe already connected (udpBuffer congested?)",Util::FormatHex(request.current(),COOKIE_SIZE).c_str()); return 0; diff --git a/CumulusLib/sources/Message.cpp b/CumulusLib/sources/Message.cpp index 950f2a5..8f43482 100644 --- a/CumulusLib/sources/Message.cpp +++ b/CumulusLib/sources/Message.cpp @@ -34,7 +34,7 @@ Message::~Message() { } BinaryReader& Message::reader(UInt32& size) { - map::const_iterator it = fragments.begin(); + std::map::const_iterator it = fragments.begin(); size = init(it==fragments.end() ? 0 : it->first); return _reader; } diff --git a/CumulusLib/sources/Middle.cpp b/CumulusLib/sources/Middle.cpp index afb5cce..1290af5 100644 --- a/CumulusLib/sources/Middle.cpp +++ b/CumulusLib/sources/Middle.cpp @@ -42,7 +42,8 @@ Middle::Middle(UInt32 id, Target& target) : ServerSession(id,farId,peer,decryptKey,encryptKey,(Invoker&)handler),_pMiddleAesDecrypt(NULL),_pMiddleAesEncrypt(NULL),_isPeer(target.isPeer), _middleId(0),_sessions(sessions),_firstResponse(false),_queryUrl("rtmfp://"+target.address.toString()+peer.path),_middlePeer(peer),_target(target) { - Util::UnpackUrl(_queryUrl,(string&)_middlePeer.path,(map&)_middlePeer.properties); + +Util::UnpackUrl(_queryUrl,(string&)_middlePeer.path,(std::map&)_middlePeer.properties); // connection to target _socket.setReceiveBufferSize(invoker.udpBufferSize);_socket.setSendBufferSize(invoker.udpBufferSize); @@ -289,7 +290,9 @@ void Middle::packetHandler(PacketReader& packet) { UInt16 netGroupHeader = content.read16();out.write16(netGroupHeader); if(netGroupHeader==0x4752) { - map::const_iterator it = peer.properties.find("groupspec"); + +std::map::const_iterator it = +peer.properties.find("groupspec"); if(it!=peer.properties.end()) { out.writeRaw(content.current(),71);content.next(71); UInt8 result1[AES_KEY_SIZE]; @@ -442,7 +445,9 @@ void Middle::targetPacketHandler(PacketReader& packet) { } else if(flagType == 0x01) { - map::const_iterator it = peer.properties.find("groupspec"); + +std::map::const_iterator it = +peer.properties.find("groupspec"); if(it!=peer.properties.end()) { packetOut.writeRaw(content.current(),68);content.next(68); UInt8 result1[AES_KEY_SIZE]; diff --git a/CumulusLib/sources/Peer.cpp b/CumulusLib/sources/Peer.cpp index d2a0ea9..584fde6 100644 --- a/CumulusLib/sources/Peer.cpp +++ b/CumulusLib/sources/Peer.cpp @@ -60,7 +60,8 @@ bool Peer::writeId(Group& group,Peer& peer,FlowWriter* pWriter) { response.write8(0x0b); // unknown response.writeRaw(peer.id,ID_SIZE); } else { - map::const_iterator it = peer._groups.find(&group); + std::map::const_iterator it = +peer._groups.find(&group); if(it==peer._groups.end()) { CRITIC("A peer in a group without have its _groups collection associated") return false; @@ -99,7 +100,8 @@ void Peer::joinGroup(Group& group,FlowWriter* pWriter) { } } - map::iterator it = _groups.lower_bound(&group); + std::map::iterator it = +_groups.lower_bound(&group); if(it!=_groups.end() && it->first==&group) return; @@ -112,7 +114,7 @@ void Peer::joinGroup(Group& group,FlowWriter* pWriter) { if(indexfirst) { // max index reached, rewritten index! index=0; - map::iterator it1; + std::map::iterator it1; for(it1=group._peers.begin();it1!=group._peers.end();++it1) (UInt32&)it1->first = index++; } @@ -124,14 +126,15 @@ void Peer::joinGroup(Group& group,FlowWriter* pWriter) { void Peer::unjoinGroup(Group& group) { - map::iterator it = _groups.lower_bound(&group); + std::map::iterator it = +_groups.lower_bound(&group); if(it==_groups.end() || it->first!=&group) return; onUnjoinGroup(it); } void Peer::unsubscribeGroups() { - map::iterator it=_groups.begin(); + std::map::iterator it=_groups.begin(); while(it!=_groups.end()) onUnjoinGroup(it++); } @@ -190,9 +193,10 @@ void Peer::onJoinGroup(Group& group) { _handler.onJoinGroup(*this,group); } -void Peer::onUnjoinGroup(map::iterator it) { +void Peer::onUnjoinGroup(std::map::iterator it) { Group& group = *it->first; - map::iterator itPeer = group._peers.find(it->second->index); + std::map::iterator itPeer = +group._peers.find(it->second->index); group._peers.erase(itPeer++); delete it->second; _groups.erase(it); diff --git a/CumulusLib/sources/Publication.cpp b/CumulusLib/sources/Publication.cpp index 11b3b04..58d806f 100644 --- a/CumulusLib/sources/Publication.cpp +++ b/CumulusLib/sources/Publication.cpp @@ -31,7 +31,7 @@ Publication::Publication(const string& name):_publisherId(0),_name(name),_firstK Publication::~Publication() { // delete _listeners! - map::iterator it; + std::map::iterator it; for(it=_listeners.begin();it!=_listeners.end();++it) delete it->second; @@ -40,7 +40,8 @@ Publication::~Publication() { Listener& Publication::addListener(Peer& peer,UInt32 id,FlowWriter& writer,bool unbuffered) { - map::iterator it = _listeners.lower_bound(id); + std::map::iterator it = +_listeners.lower_bound(id); if(it!=_listeners.end() && it->first==id) { WARN("Listener %u is already subscribed for publication %u",id,_publisherId); return *it->second; @@ -64,7 +65,7 @@ Listener& Publication::addListener(Peer& peer,UInt32 id,FlowWriter& writer,bool } void Publication::removeListener(Peer& peer,UInt32 id) { - map::iterator it = _listeners.find(id); + std::map::iterator it = _listeners.find(id); if(it==_listeners.end()) { WARN("Listener %u is already unsubscribed of publication %u",id,_publisherId); return; @@ -109,7 +110,7 @@ void Publication::start(Peer& peer,UInt32 publisherId,FlowWriter* pController) { _pPublisher=&peer; _pController=pController; _firstKeyFrame=false; - map::const_iterator it; + std::map::const_iterator it; for(it=_listeners.begin();it!=_listeners.end();++it) it->second->startPublishing(_name); flush(); @@ -124,7 +125,7 @@ void Publication::stop(Peer& peer,UInt32 publisherId) { WARN("Unpublish '%s' operation with a %u id different than its publisher %u id",_name.c_str(),publisherId,_publisherId); return; } - map::const_iterator it; + std::map::const_iterator it; for(it=_listeners.begin();it!=_listeners.end();++it) it->second->stopPublishing(_name); flush(); @@ -138,7 +139,7 @@ void Publication::stop(Peer& peer,UInt32 publisherId) { } void Publication::flush() { - map::const_iterator it; + std::map::const_iterator it; for(it=_listeners.begin();it!=_listeners.end();++it) it->second->flush(); } @@ -149,7 +150,7 @@ void Publication::pushDataPacket(const string& name,PacketReader& packet) { return; } int pos = packet.position(); - map::const_iterator it; + std::map::const_iterator it; for(it=_listeners.begin();it!=_listeners.end();++it) { it->second->pushDataPacket(name,packet); packet.reset(pos); @@ -167,7 +168,7 @@ void Publication::pushAudioPacket(UInt32 time,PacketReader& packet,UInt32 number if(numberLostFragments>0) INFO("%u audio fragments lost on publication %u",numberLostFragments,_publisherId); _audioQOS.add(time,packet.fragments,numberLostFragments,packet.available()+5,_pPublisher ? _pPublisher->ping : 0); - map::const_iterator it; + std::map::const_iterator it; for(it=_listeners.begin();it!=_listeners.end();++it) { it->second->pushAudioPacket(time,packet); packet.reset(pos); @@ -201,7 +202,7 @@ void Publication::pushVideoPacket(UInt32 time,PacketReader& packet,UInt32 number } int pos = packet.position(); - map::const_iterator it; + std::map::const_iterator it; for(it=_listeners.begin();it!=_listeners.end();++it) { it->second->pushVideoPacket(time,packet); packet.reset(pos); diff --git a/CumulusLib/sources/Publications.cpp b/CumulusLib/sources/Publications.cpp index 939fc1c..2f43704 100644 --- a/CumulusLib/sources/Publications.cpp +++ b/CumulusLib/sources/Publications.cpp @@ -24,7 +24,8 @@ using namespace Poco; namespace Cumulus { -Publications::Publications(map& publications) : _publications(publications) { +Publications::Publications(std::map& publications) +: _publications(publications) { } diff --git a/CumulusLib/sources/ServerSession.cpp b/CumulusLib/sources/ServerSession.cpp index f06f924..8907a5c 100644 --- a/CumulusLib/sources/ServerSession.cpp +++ b/CumulusLib/sources/ServerSession.cpp @@ -47,7 +47,7 @@ ServerSession::~ServerSession() { kill(); // delete helloAttempts - map::const_iterator it0; + std::map::const_iterator it0; for(it0=_helloAttempts.begin();it0!=_helloAttempts.end();++it0) delete it0->second; if(pTarget) @@ -60,7 +60,7 @@ void ServerSession::fail(const string& error) { // Here no new sending must happen except "failSignal" ServerSession::writer().clear(11); - map::const_iterator it; + std::map::const_iterator it; for(it=_flowWriters.begin();it!=_flowWriters.end();++it) it->second->clear(); peer.setFlowWriter(NULL); @@ -104,7 +104,7 @@ void ServerSession::kill() { peer.unsubscribeGroups(); // delete flows - map::const_iterator it1; + std::map::const_iterator it1; for(it1=_flows.begin();it1!=_flows.end();++it1) delete it1->second; _flows.clear(); @@ -113,7 +113,7 @@ void ServerSession::kill() { peer.onDisconnection(); // delete flowWriters - map::const_iterator it2; + std::map::const_iterator it2; for(it2=_flowWriters.begin();it2!=_flowWriters.end();++it2) delete it2->second; _flowWriters.clear(); @@ -124,7 +124,7 @@ void ServerSession::manage() { return; // clean obsolete helloAttempts - map::iterator it=_helloAttempts.begin(); + std::map::iterator it=_helloAttempts.begin(); while(it!=_helloAttempts.end()) { if(it->second->obsolete()) { delete it->second; @@ -149,7 +149,7 @@ void ServerSession::manage() { return; // Raise FlowWriter - map::iterator it2=_flowWriters.begin(); + std::map::iterator it2=_flowWriters.begin(); while(it2!=_flowWriters.end()) { try { it2->second->manage(invoker); @@ -191,7 +191,7 @@ bool ServerSession::keepAlive() { void ServerSession::eraseHelloAttempt(const string& tag) { // clean obsolete helloAttempts - map::iterator it=_helloAttempts.find(tag); + std::map::iterator it=_helloAttempts.find(tag); if(it==_helloAttempts.end()) { WARN("Hello attempt %s unfound, deletion useless",tag.c_str()); return; @@ -430,7 +430,8 @@ void ServerSession::packetHandler(PacketReader& packet) { if(_failed) break; - map::const_iterator it = _flows.find(idFlow); + std::map::const_iterator +it = _flows.find(idFlow); pFlow = it==_flows.end() ? NULL : it->second; // Header part if present @@ -511,14 +512,15 @@ void ServerSession::packetHandler(PacketReader& packet) { } FlowWriter* ServerSession::flowWriter(Poco::UInt64 id) { - map::const_iterator it = _flowWriters.find(id); + std::map::const_iterator it = +_flowWriters.find(id); if(it==_flowWriters.end()) return NULL; return it->second; } Flow& ServerSession::flow(Poco::UInt64 id) { - map::const_iterator it = _flows.find(id); + std::map::const_iterator it = _flows.find(id); if(it==_flows.end()) { WARN("Flow %s unfound",NumberFormatter::format(id).c_str()); ((UInt64&)_pFlowNull->id) = id; @@ -532,7 +534,7 @@ Flow* ServerSession::createFlow(UInt64 id,const string& signature) { ERROR("Session %u is died, no more Flow creation possible",this->id); return NULL; } - map::const_iterator it = _flows.find(id); + std::map::const_iterator it = _flows.find(id); if(it!=_flows.end()) { WARN("Flow %s has already been created",NumberFormatter::format(id).c_str()); return it->second; diff --git a/CumulusLib/sources/Sessions.cpp b/CumulusLib/sources/Sessions.cpp index f2f5df7..ff0866d 100644 --- a/CumulusLib/sources/Sessions.cpp +++ b/CumulusLib/sources/Sessions.cpp @@ -65,7 +65,7 @@ Session* Sessions::add(Session* pSession) { return pSession; } -void Sessions::remove(map::iterator it) { +void Sessions::remove(std::map::iterator it) { ScopedLock lock(mutex); DEBUG("Session %u died",it->second->id); _gateway.destroySession(*it->second); @@ -83,7 +83,8 @@ void Sessions::changeAddress(const SocketAddress& oldAddress,Session& session) { Session* Sessions::find(const Poco::Net::SocketAddress& address) { ScopedLock lock(mutex); - map::const_iterator it = _sessionsByAddress.find(address); + std::map::const_iterator it = +_sessionsByAddress.find(address); if(it==_sessionsByAddress.end()) return NULL; return it->second; @@ -101,7 +102,7 @@ Session* Sessions::find(const Poco::UInt8* peerId) { Session* Sessions::find(UInt32 id) { ScopedLock lock(mutex); - map::iterator it = _sessions.find(id); + std::map::iterator it = _sessions.find(id); if(it==_sessions.end()) return NULL; return it->second; @@ -109,7 +110,7 @@ Session* Sessions::find(UInt32 id) { void Sessions::manage() { ScopedLock lock(mutex); - map::iterator it= _sessions.begin(); + std::map::iterator it= _sessions.begin(); while(it!=_sessions.end()) { it->second->manage(); if(it->second->died) { diff --git a/CumulusLib/sources/SocketManager.cpp b/CumulusLib/sources/SocketManager.cpp index 8b0f172..a943bf9 100644 --- a/CumulusLib/sources/SocketManager.cpp +++ b/CumulusLib/sources/SocketManager.cpp @@ -68,7 +68,7 @@ SocketManager::~SocketManager() { void SocketManager::clear() { { ScopedLock lock(_mutex); - map::iterator it; + std::map::iterator it; for(it=_sockets.begin();it!= _sockets.end();++it) { ((SocketManagedImpl*)it->second->socketSelectable.impl())->pSocketManaged = NULL; delete it->second; @@ -80,7 +80,8 @@ void SocketManager::clear() { void SocketManager::add(Socket& socket,SocketHandler& handler) { ScopedLock lock(_mutex); - map::iterator it = _sockets.lower_bound(&socket); + std::map::iterator it = +_sockets.lower_bound(&socket); if(it!=_sockets.end() && it->first==&socket) return; if(it!=_sockets.begin()) @@ -92,7 +93,8 @@ void SocketManager::add(Socket& socket,SocketHandler& handler) { void SocketManager::remove(const Socket& socket) { ScopedLock lock(_mutex); - map::iterator it = _sockets.find(&socket); + std::map::iterator it = +_sockets.find(&socket); if(it == _sockets.end()) return; ((SocketManagedImpl*)it->second->socketSelectable.impl())->pSocketManaged = NULL; @@ -153,7 +155,8 @@ void SocketManager::run() { _writables.clear(); int i=0; - map::iterator it; + std::map::iterator +it; for(it = _sockets.begin(); it != _sockets.end(); ++it) { empty=false; SocketManaged& socket = *it->second; diff --git a/CumulusLib/sources/Streams.cpp b/CumulusLib/sources/Streams.cpp index e4f3a67..a002a4f 100644 --- a/CumulusLib/sources/Streams.cpp +++ b/CumulusLib/sources/Streams.cpp @@ -23,7 +23,8 @@ using namespace Poco; namespace Cumulus { -Streams::Streams(map& publications) : _nextId(0),_publications(publications) { +Streams::Streams(std::map& publications) : +_nextId(0),_publications(publications) { } diff --git a/CumulusLib/sources/Util.cpp b/CumulusLib/sources/Util.cpp index 4c96488..21ed1ec 100644 --- a/CumulusLib/sources/Util.cpp +++ b/CumulusLib/sources/Util.cpp @@ -56,13 +56,15 @@ UInt8 Util::Get7BitValueSize(UInt64 value) { return result; } -void Util::UnpackUrl(const string& url,string& path,map& properties) { +void Util::UnpackUrl(const string& url,string& +path,std::map& properties) { string host; UInt16 port; UnpackUrl(url,host,port,path,properties); } -void Util::UnpackUrl(const string& url,string& host,UInt16& port,string& path,map& properties) { +void Util::UnpackUrl(const string& url,string& host,UInt16& port,string& +path,std::map& properties) { try { URI uri(url); uri.normalize(); @@ -78,7 +80,8 @@ void Util::UnpackUrl(const string& url,string& host,UInt16& port,string& path,ma } } -void Util::UnpackQuery(const string& query,map& properties) { +void Util::UnpackQuery(const string& query,std::map& +properties) { istringstream istr(query); static const int eof = std::char_traits::eof(); diff --git a/CumulusServer/sources/LUAClient.cpp b/CumulusServer/sources/LUAClient.cpp index 4b9a453..a57da11 100644 --- a/CumulusServer/sources/LUAClient.cpp +++ b/CumulusServer/sources/LUAClient.cpp @@ -53,7 +53,8 @@ int LUAClient::Get(lua_State *pState) { } else if(name=="swfUrl") { SCRIPT_WRITE_STRING(client.swfUrl.toString().c_str()) } else { - map::const_iterator it = client.properties.find(name); + std::map::const_iterator it = +client.properties.find(name); if(it!=client.properties.end()) SCRIPT_WRITE_BINARY(it->second.c_str(),it->second.size()) } diff --git a/CumulusServer/sources/LUAServer.cpp b/CumulusServer/sources/LUAServer.cpp index b2f61b8..9a03abc 100644 --- a/CumulusServer/sources/LUAServer.cpp +++ b/CumulusServer/sources/LUAServer.cpp @@ -49,7 +49,8 @@ int LUAServer::Get(lua_State* pState) { } else if(name=="address") { SCRIPT_WRITE_STRING(server.address.c_str()) } else { - map::const_iterator it = server.properties.find(name); + std::map::const_iterator it = +server.properties.find(name); if(it!=server.properties.end()) SCRIPT_WRITE_BINARY(it->second.c_str(),it->second.size()) } diff --git a/CumulusServer/sources/Script.cpp b/CumulusServer/sources/Script.cpp index fcb1b57..9fc4797 100644 --- a/CumulusServer/sources/Script.cpp +++ b/CumulusServer/sources/Script.cpp @@ -334,11 +334,12 @@ void Script::WriteAMF(lua_State *pState,AMF::Type type,AMFReader& reader) { } void Script::ReadAMF(lua_State* pState,AMFWriter& writer,UInt32 count) { - map references; + std::map references; ReadAMF(pState,writer,count,references); } -void Script::ReadAMF(lua_State* pState,AMFWriter& writer,UInt32 count,map& references) { +void Script::ReadAMF(lua_State* pState,AMFWriter& writer,UInt32 +count,std::map& references) { SCRIPT_BEGIN(pState) int top = lua_gettop(pState); Int32 args = top-count; @@ -353,7 +354,8 @@ void Script::ReadAMF(lua_State* pState,AMFWriter& writer,UInt32 count,map::iterator it = references.lower_bound(reference); + std::map::iterator it = +references.lower_bound(reference); if(it!=references.end() && it->first==reference) { if(writer.repeat(it->second)) break; diff --git a/CumulusServer/sources/Server.cpp b/CumulusServer/sources/Server.cpp index fb31bd6..5c7c98d 100644 --- a/CumulusServer/sources/Server.cpp +++ b/CumulusServer/sources/Server.cpp @@ -118,7 +118,7 @@ void Server::stopService(Service& service) { SCRIPT_END } void Server::clearService(Service& service) { - map >::iterator it; + std::map >::iterator it; for(it=_scriptEvents.begin();it!=_scriptEvents.end();++it) it->second.erase(&service); } @@ -202,7 +202,9 @@ void Server::onRendezVousUnknown(const UInt8* id,set& addresses) { } } -void Server::onHandshake(const SocketAddress& address,const string& path,const map& properties,UInt32 attempts,set& addresses) { +void Server::onHandshake(const SocketAddress& address,const string& +path,const std::map& properties,UInt32 +attempts,set& addresses) { Service* pService = _pService->get(path); if(!pService) return; @@ -211,7 +213,7 @@ void Server::onHandshake(const SocketAddress& address,const string& path,const m SCRIPT_WRITE_STRING(address.toString().c_str()) SCRIPT_WRITE_STRING(path.c_str()) lua_newtable(_pState); - map::const_iterator it; + std::map::const_iterator it; for(it=properties.begin();it!=properties.end();++it) { lua_pushlstring(_pState,it->second.c_str(),it->second.size()); lua_setfield(_pState,-2,it->first.c_str()); diff --git a/CumulusServer/sources/ServerConnection.cpp b/CumulusServer/sources/ServerConnection.cpp index c1ef0ab..195d27f 100644 --- a/CumulusServer/sources/ServerConnection.cpp +++ b/CumulusServer/sources/ServerConnection.cpp @@ -29,7 +29,8 @@ using namespace Poco::Net; ServerConnection::ServerConnection(const string& target,SocketManager& socketManager,ServerHandler& handler,ServersHandler& serversHandler) : address(target),_size(0),_handler(handler),TCPClient(socketManager),_connected(false),_serversHandler(serversHandler),isTarget(true) { size_t found = target.find("?"); if(found!=string::npos) { - Util::UnpackQuery(target.substr(found+1),(map&)properties); + +Util::UnpackQuery(target.substr(found+1),(std::map&)properties); ((string&)address).assign(target.substr(0,found)); } } @@ -52,7 +53,7 @@ void ServerConnection::sendPublicAddress() { message.write8(1); message << _handler.publicAddress(); } - map::const_iterator it; + std::map::const_iterator it; for(it=properties.begin();it!=properties.end();++it) { message << it->first; message << it->second; @@ -79,7 +80,8 @@ void ServerConnection::send(const string& handler,ServerMessage& message) { UInt32 handlerRef=0; bool writeRef = false; if(!handlerName.empty()) { - map::iterator it = _sendingRefs.lower_bound(handlerName); + std::map::iterator it = +_sendingRefs.lower_bound(handlerName); if(it!=_sendingRefs.end() && it->first==handlerName) { handlerRef = it->second; handlerName.clear(); @@ -135,7 +137,8 @@ UInt32 ServerConnection::onReception(const UInt8* data,UInt32 size) { } else { UInt32 ref = reader.read7BitEncoded(); if(ref>0) { - map::const_iterator it = _receivingRefs.find(ref); + std::map::const_iterator it = +_receivingRefs.find(ref); if(it==_receivingRefs.end()) ERROR("Impossible to find the %u handler reference for the server %s",ref,peerAddress().toString().c_str()) else @@ -153,7 +156,8 @@ UInt32 ServerConnection::onReception(const UInt8* data,UInt32 size) { string key,value; reader >> key; reader >> value; - ((map&)properties).insert(pair(key,value)); + +((std::map&)properties).insert(pair(key,value)); } if(!_connected) { _connected=true; diff --git a/CumulusServer/sources/Service.cpp b/CumulusServer/sources/Service.cpp index 28dd43b..ebf33f9 100644 --- a/CumulusServer/sources/Service.cpp +++ b/CumulusServer/sources/Service.cpp @@ -36,7 +36,7 @@ Service::Service(lua_State* pState,const string& path,ServiceRegistry& registry) Service::~Service() { // delete services children - map::const_iterator it; + std::map::const_iterator it; for(it=_services.begin();it!=_services.end();++it) delete it->second; // clean @@ -65,7 +65,8 @@ Service* Service::get(const string& path) { File file(Path(FileWatcher::path).parent().toString()+name); bool exists = (file.exists() && file.isDirectory()); - map::iterator it = _services.lower_bound(name); + std::map::iterator it = +_services.lower_bound(name); if(it!=_services.end() && it->first==name) { // Service exists already