本文整理汇总了C++中PropertiesPtr::end方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertiesPtr::end方法的具体用法?C++ PropertiesPtr::end怎么用?C++ PropertiesPtr::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertiesPtr
的用法示例。
在下文中一共展示了PropertiesPtr::end方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
bool CPacketizer::initialize(PropertiesPtr properties)
{
Properties::iterator ret;
ret=properties->find(std::string("hdrLength"));
if (ret == properties->end())
{
LOG_ERROR("hdrLength not present in config file");
return false;
}
else
{
int* hdr=boost::any_cast<int>(&(ret->second));
if (hdr == NULL)
{
LOG_ERROR("hdrLength not an integer value");
return false;
}
hdrLength_=*hdr;
}
#if 0
ret=(*serverDetails)->find(std::string("bodyLength"));
if (ret == (*serverDetails)->end())
{
LOG_ERROR("bodyLength not present in config file");
return false;
}
else
{
int* bodyLen=boost::any_cast<int>(&(ret->second));
if (bodyLen == NULL)
{
LOG_ERROR("bodyLength not an integer value");
return false;
}
bodyLength_=*bodyLen;
}
#endif
std::ostringstream tmp;
tmp << "Cpacketize initialized with header length " << hdrLength_;
LOG_DEBUG(tmp.str());
return true;
}
示例2: initialize
void Rmi::initialize(PropertiesPtr& rmiSection)
{
Properties::iterator ret;
// initialize multi server
ret=rmiSection->find(std::string("multiServer"));
if (ret != rmiSection->end())
{
PropertiesPtr* serverDetails=boost::any_cast<PropertiesPtr>(&(ret->second));
if (serverDetails== NULL)
{
LOG_ERROR("multiServer details not found ");
}
else
serverStub_.reset(new Fog::Network::MultiServer(*serverDetails));
}
else
{
LOG_ERROR("multi server not present in config file");
}
// initialize client
ret=rmiSection->find(std::string("client"));
if (ret != rmiSection->end())
{
PropertiesPtr* clientDetails=boost::any_cast<PropertiesPtr>(&(ret->second));
if (clientDetails== NULL)
{
LOG_ERROR("client details not found ");
}
else
clientStub_.reset(new Fog::Network::TCPClient(*clientDetails));
}
else
{
LOG_ERROR("client not present in config file");
}
// store the packetizer section
ret=rmiSection->find(std::string("cpacketizer"));
if (ret != rmiSection->end())
{
PropertiesPtr* pktPtr=boost::any_cast<PropertiesPtr>(&(ret->second));
if (pktPtr == NULL)
{
LOG_ERROR("unable to extract packetizer section from rmi");
}
else
{
packetizerSection_=*pktPtr;
cliPkter_.reset(new Fog::Network::CPacketizer(packetizerSection_));
}
}
else
{
LOG_ERROR("packetizer detail not found ");
}
// set up the connection for the server and for client on initial connection
if (serverStub_)
{
(serverStub_->OnAccept).connect(boost::bind(&Fog::Network::Rmi::acceptConnection, this, _1));
serverStub_->startAccept();
}
if (clientStub_)
{
(clientStub_->OnConnect).connect(boost::bind(&Fog::Network::Rmi::onConnect, this, _1));
clientStub_->startConnect();
}
}