当前位置: 首页>>代码示例>>C++>>正文


C++ STRING_LIST::end方法代码示例

本文整理汇总了C++中STRING_LIST::end方法的典型用法代码示例。如果您正苦于以下问题:C++ STRING_LIST::end方法的具体用法?C++ STRING_LIST::end怎么用?C++ STRING_LIST::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在STRING_LIST的用法示例。


在下文中一共展示了STRING_LIST::end方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetConfigurationParam

///                               READ STRINGS
bool CProcessConfigReader::GetConfigurationParam(std::string sAppName,std::string sParam, std::string &sVal)
{
    Reset();

    //remember all names we were asked for....
    std::string sl = sParam;
    MOOSToLower(sl);
    m_Audit[sAppName].insert(sl);

    STRING_LIST sParams;

    if(GetConfigurationAndPreserveSpace( sAppName, sParams))
    {
        STRING_LIST::iterator p;
        for(p = sParams.begin(); p!=sParams.end(); p++)
        {
            std::string sTmp = *p;
            std::string sTok = MOOSChomp(sTmp,"=");
            MOOSTrimWhiteSpace(sTok);

            if (sTmp.empty())
                return false;

            if(MOOSStrCmp(sTok,sParam))
            {
                MOOSTrimWhiteSpace(sTmp);

                sVal=sTmp;
                return true;
            }
        }
    }
    return false;
}
开发者ID:nicolaje,项目名称:core-moos,代码行数:35,代码来源:ProcessConfigReader.cpp

示例2: MakeCustomSummary

bool CMOOSRemoteLite::MakeCustomSummary()
{

    STRING_LIST sParams;
    if(m_MissionReader.GetConfiguration(GetAppName(),sParams))
    {
        STRING_LIST::iterator p;

        for(p = sParams.begin();p!=sParams.end();p++)
        {
            string sLine = *p;
            string sTok,sVal;
            m_MissionReader.GetTokenValPair(sLine,sTok,sVal);

            if(MOOSStrCmp(sTok,"CUSTOMSUMMARY"))
            {
                m_CustomSummaryList.push_front(sVal);

                AddMOOSVariable(sVal,sVal,"",0.2);
            }
        }
    }

    RegisterMOOSVariables();

    return true;
}
开发者ID:HSOFEUP,项目名称:MOOS-IvP-releases,代码行数:27,代码来源:MOOSRemoteLite.cpp

示例3: OnPreIterate

bool CHelmApp::OnPreIterate()
{
    TASK_LIST::iterator p;

    STRING_LIST NewResources;
    STRING_LIST::iterator q;

    for(p = m_Tasks.begin();p!=m_Tasks.end();p++)
    {
        CMOOSBehaviour* pBehaviour = *p;

        if(pBehaviour->HasNewRegistration())
        {
            NewResources.clear();

            pBehaviour->GetRegistrations(NewResources);

            for(q = NewResources.begin();q!=NewResources.end();q++)
            {
                if(m_Comms.IsConnected())
                {
                    m_Comms.Register(*q,UPDATE_INTERVAL);
                }
            }
        }
    }

    return true;
}
开发者ID:alod83,项目名称:IS-MOOS,代码行数:29,代码来源:HelmApp.cpp

示例4: OnProcessSummaryRequested

bool CMOOSDB::OnProcessSummaryRequested(CMOOSMsg &Msg, MOOSMSG_LIST &MsgTxList)
{
    DBVAR_MAP::iterator p;
    STRING_LIST::iterator q;
    STRING_LIST Clients;
    
    m_pCommServer->GetClientNames(Clients);

    for(q=Clients.begin();q!=Clients.end();q++)
    {
        string sWho = *q;
        
        string sPublished= "PUBLISHED=";
        string sSubscribed = "SUBSCRIBED=";
        
        for(p=m_VarMap.begin();p!=m_VarMap.end();p++)
        {
            CMOOSDBVar  & rVar = p->second;
            
            if(rVar.m_Writers.find(sWho)!=rVar.m_Writers.end())
            {
                if(!sPublished.empty())
                {
                    sPublished+=",";
                }
                sPublished+=rVar.m_sName;
                
            }
            
            if(rVar.m_Subscribers.find(sWho)!=rVar.m_Subscribers.end())
            {
                if(!sSubscribed.empty())
                {
                    sSubscribed+=",";
                }
                sSubscribed+=rVar.m_sName;
            }
        }
        
        
        CMOOSMsg MsgReply;
        
        MsgReply.m_nID        = Msg.m_nID;
        
        MsgReply.m_cMsgType   = MOOS_NOTIFY;
        MsgReply.m_cDataType  = MOOS_STRING;
        MsgReply.m_dfTime     = MOOSTime()-m_dfStartTime; //for display
        MsgReply.m_sSrc       = m_sDBName;
        MsgReply.m_sKey       = "PROC_SUMMARY";
        MsgReply.m_sVal       = sWho+":"+sSubscribed+","+sPublished;
        MsgReply.m_dfVal      = -1;
        
        
        MsgTxList.push_front(MsgReply);
    }
    
    return true;
    
}
开发者ID:HSOFEUP,项目名称:MOOS-IvP-releases,代码行数:59,代码来源:MOOSDB.cpp

示例5: UpdateReadWriteSummaryVar

void CMOOSDB::UpdateReadWriteSummaryVar()
{

    std::map<std::string,std::list<std::string> > Pub;
    std::map<std::string,std::list<std::string> > Sub;

    DBVAR_MAP::iterator p;

    for(p=m_VarMap.begin();p!=m_VarMap.end();p++)
    {
        CMOOSDBVar  & rVar = p->second;
        STRING_SET::iterator w;
        REGISTER_INFO_MAP::iterator v;

        std::stringstream ss;
        for(v = rVar.m_Subscribers.begin();v!=rVar.m_Subscribers.end();v++)
            Sub[v->second.m_sClientName].push_back(rVar.m_sName);

        for(w = rVar.m_Writers.begin();w!=rVar.m_Writers.end();w++)
            Pub[*w].push_back(rVar.m_sName);
    }


    STRING_LIST Clients;
    m_pCommServer->GetClientNames(Clients);
    STRING_LIST::iterator q;

    std::ostringstream ss;
    for(q=Clients.begin();q!=Clients.end();)
    {
        ss<<*q<<"=";
        PrintCollection(Sub[*q],ss,":");
        ss<<"&";
        PrintCollection(Pub[*q],ss,":");

        if(++q!=Clients.end())
            ss<<",";

    }

    CMOOSMsg DBS(MOOS_NOTIFY,"DB_RWSUMMARY",ss.str());
    DBS.m_sSrc = m_sDBName;
    DBS.m_sOriginatingCommunity = m_sCommunityName;
    OnNotify(DBS);

}
开发者ID:HSOFEUP,项目名称:MOOS-IvP-releases,代码行数:46,代码来源:MOOSDB.cpp

示例6: OnStartUp

bool SonarFilter::OnStartUp()
{
  AppCastingMOOSApp::OnStartUp();

  STRING_LIST sParams;
  m_MissionReader.EnableVerbatimQuoting(false);
  if(!m_MissionReader.GetConfiguration(GetAppName(), sParams))
    reportConfigWarning("No config block found for " + GetAppName());

  STRING_LIST::iterator p;
  for(p=sParams.begin(); p!=sParams.end(); p++) {
    string orig  = *p;
    string line  = *p;
    string param = toupper(biteStringX(line, '='));
    string value = line;

    bool handled = false;
    if(param == "FILTERLEN") {
      m_filter_len = atoi(value.c_str());
      handled = true;
    }
    else if(param == "STDEVLIMIT") {
      m_std_limit = atof(value.c_str());
      handled = true;
    } else if (param == "SIMSWATHANGLE") {
      // Convert the angle to radians
      m_sim_swath_angle = atof(value.c_str()) * M_PI / 180;
      handled = true;
    } else if (param == "SONARTYPE") {

    }

    if(!handled)
      reportUnhandledConfigWarning(orig);

  }

  AddMOOSVariable("X", "NAV_X", "", 0);
  AddMOOSVariable("Y", "NAV_Y", "", 0);
  AddMOOSVariable("Heading", "NAV_HEADING", "", 0);
  AddMOOSVariable("Depth", "SONAR_DEPTH_M", "", 0);
  AddMOOSVariable("Depth_Stbd", "SONAR_DEPTH_STBD_M", "", 0);
  AddMOOSVariable("Depth_Port", "SONAR_DEPTH_PORT_M", "", 0);
  AddMOOSVariable("SonarWidth", "SONAR_WIDTH", "", 0);
  AddMOOSVariable("Swath", "", "SWATH_WIDTH", 0);

  m_nadir_filter = StDevFilter(m_filter_len, m_std_limit, 1/GetAppFreq());
  m_port_filter = StDevFilter(m_filter_len, m_std_limit, 1/GetAppFreq());
  m_stbd_filter = StDevFilter(m_filter_len, m_std_limit, 1/GetAppFreq());

  registerVariables();
  return(true);
}
开发者ID:CCOMJHC,项目名称:moos-ivp-manda,代码行数:53,代码来源:SonarFilter.cpp

示例7: SetUpSensorChannels

bool CMOOSNavEngine::SetUpSensorChannels(STRING_LIST  sParams,string sToken)
{

       
    //ok we need to load up rejection settings
    STRING_LIST::iterator p;
    
    for(p = sParams.begin();p!=sParams.end();p++)
    {
        string sLine = *p;
        if(sLine.find(sToken)!=string::npos)
        {
            MOOSRemoveChars(sLine," \t");
            MOOSChomp(sLine,"=");
            //LSQ_REJECTION = TheAvtrak : Reject = 3, History = 5,Fail = 0.001           
            CMOOSSensorChannel NewChannel;
            
            string sSensor =    MOOSChomp(sLine,":");
            string sHistory =    MOOSChomp(sLine,",");
            string sFail =        MOOSChomp(sLine,",");

            MOOSChomp(sHistory,"=");
            MOOSChomp(sFail,"=");

            
            if(sFail.empty() ||sHistory.empty())
            {
                MOOSTrace("error in %s line!\n",sToken.c_str());
                return false;
            }
            
            int nDepth = atoi(sHistory.c_str());
            if(nDepth>0)
            {
                NewChannel.SetHistoryDepth(nDepth);
            }
            

               double dfFail = atof(sFail.c_str());
            if(dfFail>0)
            {
                NewChannel.SetNoiseLimit(dfFail);
            }

            NewChannel.SetName(sSensor);

            m_SensorChannelMap[sSensor]=NewChannel;
            
        }       
    }

    return true;
}
开发者ID:alod83,项目名称:IS-MOOS,代码行数:53,代码来源:MOOSNavEngine.cpp

示例8: MakeCustomKeys

bool CMOOSRemoteLite::MakeCustomKeys()
{
    STRING_LIST sParams;

    if(m_MissionReader.GetConfiguration(GetAppName(),sParams))
    {
        STRING_LIST::iterator p;

        for(p = sParams.begin();p!=sParams.end();p++)
        {
            string sLine = *p;
            string sTok,sVal;
            m_MissionReader.GetTokenValPair(sLine,sTok,sVal);



            if(MOOSStrCmp(sTok,"CUSTOMKEY"))
            {

                MOOSRemoveChars(sVal," ");
                string sChar = MOOSChomp(sVal,":");
                string sKey = MOOSChomp(sVal,"@");
                MOOSRemoveChars(sVal,"\"");
                string sTx = MOOSChomp(sVal,"$");

                bool  bIsNumeric = MOOSIsNumeric(sTx);						
				bool bAskToConfirm = (sVal == "confirm");

                if(!sChar.empty())
                {

                    CCustomKey NewKey;
                    NewKey.m_cChar = sChar[0];
                    NewKey.m_sKey = sKey;
                    NewKey.m_sVal = sTx;
                    NewKey.bIsNumeric = bIsNumeric;
                    NewKey.bAskToConfirm = bAskToConfirm;

                    if(isdigit(NewKey.m_cChar))
                    {
                        m_CustomKeys[NewKey.m_cChar] = NewKey;
                    }
                    else
                    {
                        MOOSTrace("CMOOSRemote: can only bind custom keys to numeric characters!\n");
                    }
                }

            }
        }
    }
    return true;
}
开发者ID:HSOFEUP,项目名称:MOOS-IvP-releases,代码行数:53,代码来源:MOOSRemoteLite.cpp

示例9: OnStartUp

bool DeadManPost::OnStartUp()
{
  AppCastingMOOSApp::OnStartUp();

  STRING_LIST sParams;
  m_MissionReader.EnableVerbatimQuoting(false);
  if(!m_MissionReader.GetConfiguration(GetAppName(), sParams))
    reportConfigWarning("No config block found for " + GetAppName());

  STRING_LIST::iterator p;
  for(p=sParams.begin(); p!=sParams.end(); p++) {
    string orig  = *p;
    string line  = *p;
    string param = tolower(biteStringX(line, '='));
    string value = line;

    bool handled = false;
    if(param == "heartbeat_var") {
      if(!strContainsWhite(value)) {
	m_heart_var = value;
	handled = true;
      }
    }
    else if(param == "deadflag") {
      string varname = biteStringX(value, '=');
      string varval  = value;
      if(!strContainsWhite(varname) && (varval != "")) {
	VarDataPair pair(varname, varval, "auto");
	m_deadflags.push_back(pair);
	handled = true;
      }
    }
    else if(param == "post_policy") {
      string val = tolower(value);
      if((val=="once") || (val=="repeat") || (val=="reset")) {
	m_post_policy = val;
	handled = true;
      }
    }
    else if((param == "max_noheart") && isNumber(value)) {
      m_max_noheart = atof(value.c_str());
      handled = true;
    }
    else if(param == "active_at_start") 
      handled = setBooleanOnString(m_active_at_start, value);

    if(!handled)
      reportUnhandledConfigWarning(orig);
  }
  
  registerVariables();	
  return(true);
}
开发者ID:HSOFEUP,项目名称:MOOS-IvP-releases,代码行数:53,代码来源:DeadManPost.cpp

示例10: OnStartUp

bool HazardMgr::OnStartUp()
{
  AppCastingMOOSApp::OnStartUp();

  STRING_LIST sParams;
  m_MissionReader.EnableVerbatimQuoting(true);
  if(!m_MissionReader.GetConfiguration(GetAppName(), sParams))
    reportConfigWarning("No config block found for " + GetAppName());

  STRING_LIST::iterator p;
  for(p=sParams.begin(); p!=sParams.end(); p++) {
    string orig  = *p;
    string line  = *p;
    string param = tolower(biteStringX(line, '='));
    string value = line;

    bool handled = false;
    if((param == "swath_width") && isNumber(value)) {
      m_swath_width_desired = atof(value.c_str());
      handled = true;
    }
    else if(((param == "sensor_pd") || (param == "pd")) && isNumber(value)) {
      m_pd_desired = atof(value.c_str());
      handled = true;
    }
    else if(param == "report_name") {
      value = stripQuotes(value);
      m_report_name = value;
      handled = true;
    }
    else if(param == "region") {
      XYPolygon poly = string2Poly(value);
      if(poly.is_convex())
	m_search_region = poly;
      handled = true;
    }

    if(!handled)
      reportUnhandledConfigWarning(orig);
  }

  m_hazard_set.setSource(m_host_community);
  m_hazard_set.setName(m_report_name);
  m_hazard_set.setRegion(m_search_region);

  m_voted_hazard_set.setSource(m_host_community);
  m_voted_hazard_set.setName(m_report_name);
  m_voted_hazard_set.setRegion(m_search_region);

  registerVariables();
  return(true);
}
开发者ID:nicrip,项目名称:moos-ivp-rypkema,代码行数:52,代码来源:HazardMgr.cpp

示例11: UpdateDBClientsVar

void CMOOSDB::UpdateDBClientsVar()
{
    STRING_LIST Clients;
    m_pCommServer->GetClientNames(Clients);

    std::ostringstream ss;
    std::copy(Clients.begin(),Clients.end(),ostream_iterator<std::string>(ss,","));

    CMOOSMsg DBC(MOOS_NOTIFY,"DB_CLIENTS",ss.str());
    DBC.m_sOriginatingCommunity = m_sCommunityName;
    DBC.m_sSrc = m_sDBName;
    OnNotify(DBC);

}
开发者ID:HSOFEUP,项目名称:MOOS-IvP-releases,代码行数:14,代码来源:MOOSDB.cpp

示例12: OnStartUp

bool GPS::OnStartUp() {
    AppCastingMOOSApp::OnStartUp();

    STRING_LIST sParams;
    m_MissionReader.EnableVerbatimQuoting(false);
    if (!m_MissionReader.GetConfiguration(GetAppName(), sParams))
        reportConfigWarning("No config block found for " + GetAppName());

    STRING_LIST::iterator p;
    for (p = sParams.begin(); p != sParams.end(); p++) {
        string orig = *p;
        string line = *p;
        string param = toupper(biteStringX(line, '='));
        string value = line;

        bool handled = false;
        if (param == "SERIAL_PORT") {
            m_uart_port = value.c_str();
            handled = true;
        }
        if (param == "UART_BAUD_RATE") {
            m_uart_baud_rate = atoi(value.c_str());
            handled = true;
        }
        if (!handled)
            reportUnhandledConfigWarning(orig);
    }

    registerVariables();
    // Init GPS connection


    m_error = m_serial.open(m_uart_port,m_error);
    if (m_error.value() != 0.0)
    {
        // No error from asio read
        reportConfigWarning("Serial open error");
    }
    else
        m_serial.set_option(boost::asio::serial_port_base::baud_rate(m_uart_baud_rate));
    //serial.set_option(boost::asio::serial_port_base::character_size());
    //serial.set_option(boost::asio::serial_port_base::flow_control());
    //serial.set_option(boost::asio::serial_port_base::parity());
    //serial.set_option(boost::asio::serial_port_base::stop_bits());
    if(!m_serial.is_open()){
        reportConfigWarning("Serial port not open");
    }

    return (true);
}
开发者ID:ClementAubry,项目名称:moos-ivp-toutatis,代码行数:50,代码来源:GPS.cpp

示例13: DoCustomJournal

bool CMOOSRemoteLite::DoCustomJournal(char cCmd)
{
    CUSTOMJOURNAL_MAP::iterator p;
    for(p = m_CustomJournals.begin();p!=m_CustomJournals.end();p++)
    {
        if(p->second.m_cKey==cCmd)
        {
            MOOSTrace("\nJournal Entries for \"%s\" :\n  ",p->first.c_str());
            STRING_LIST Cpy = p->second.m_Entries;
            std::copy(Cpy.begin(),Cpy.end(),std::ostream_iterator<std::string>(std::cout,"\n  "));
            return true;
        }
    }
    return false;
}
开发者ID:HSOFEUP,项目名称:MOOS-IvP-releases,代码行数:15,代码来源:MOOSRemoteLite.cpp

示例14: getConfigItemAttributes

Triggerconf::ATTRIBUTE_MAP Triggerconf::getConfigItemAttributes (string module, string submodule, string configitem)
{
	ATTRIBUTE_MAP ret;	
	STRING_LIST names = getConfigAttributeNames (module, submodule, configitem);

	STRING_LIST_ITERATOR	begin	= names.begin();
	STRING_LIST_ITERATOR	end	= names.end();

	for ( ; begin != end; begin++) {
		
		string value	= getConfigAttributeValue (module, submodule, configitem, *begin);
		ret.insert	(ATTRIBUTE_PAIR (*begin, value));

	} // for ( ; begin != end; begin++) 

	return ret;
}
开发者ID:freshbob,项目名称:worms-attack,代码行数:17,代码来源:triggerconf.cpp

示例15: untokenize

string Triggerconf::untokenize (STRING_LIST path)
{
	STRING_LIST::iterator begin = path.begin();
	STRING_LIST::iterator end = path.end();
	string ret;

	for ( ; begin != end; begin++) {
		
		if (ret.length () == 0)
			ret += *begin;
		else
			ret += (PATH_DELIMITER + *begin);

	}

	return ret;
}
开发者ID:freshbob,项目名称:worms-attack,代码行数:17,代码来源:triggerconf.cpp


注:本文中的STRING_LIST::end方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。