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


C++ ISTR函数代码示例

本文整理汇总了C++中ISTR函数的典型用法代码示例。如果您正苦于以下问题:C++ ISTR函数的具体用法?C++ ISTR怎么用?C++ ISTR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: DEBUG

//=============================================================================
// CONSTRUCTOR: SPELLwsFrame::SPELLwsFrame
//=============================================================================
SPELLwsFrame::SPELLwsFrame( const SPELLwsStartupInfo& info, unsigned int depth, PyFrameObject* frame )
{
	// If mode is recover and depth > 0, 'frame' contains the f_back frame.
	// If depth is zero and mode is recover, we just need to fix the dynamics.
	// If mode is other, 'frame' contains the frame associated to this structure.
	if (info.performRecovery)
	{
		DEBUG("[FRM] Recovering " + ISTR(depth) + " level frame");
		m_static = new SPELLwsStaticData(info,depth,frame);
		// Recover this frame
		m_frame = m_static->restore();
		// In recovery mode, the given frame is the previous one in the stack
		m_frame->f_back = frame;
		// Use the recovered frame to restore dynamic data
		m_dynamic = new SPELLwsDynamicData(info,depth,m_frame);
		m_dynamic->restore();
		DEBUG("[FRM] Recovering " + ISTR(depth) + " level frame done: " + PYCREPR(m_frame));
	}
	else
	{
		m_frame = frame;
		m_static = new SPELLwsStaticData(info,depth,m_frame);
		m_dynamic = new SPELLwsDynamicData(info,depth,m_frame);
	}
	DEBUG("[FRM] Created manager for frame " + PYCREPR(m_frame));
	m_lastInstruction = m_frame->f_lasti;
	m_lastLine = m_frame->f_lineno;
}
开发者ID:seciltabur,项目名称:spell-sat,代码行数:31,代码来源:SPELLwsFrame.C

示例2: STRI

//=============================================================================
// METHOD: SPELLlistenerContext::onNewContext
//=============================================================================
void SPELLlistenerContext::onNewContext( const SPELLipcMessage& msg )
{
    ContextInfo* ctxInfo;

    std::string ctxName = msg.get(MessageField::FIELD_CTX_NAME);

    ctxInfo = &m_openContexts[ctxName];
    ctxInfo->m_key = msg.getKey();
    ctxInfo->m_port = STRI(msg.get(MessageField::FIELD_CTX_PORT));
    ctxInfo->m_status = MessageValue::DATA_CTX_RUNNING;

    DEBUG("New context:");
    DEBUG("- Name=" + ctxInfo->m_name);
    DEBUG("- Key=" + ISTR(ctxInfo->m_key));
    DEBUG("- Port=" + ISTR(ctxInfo->m_port));
    DEBUG("- Status=" + ctxInfo->m_status);

    m_waitForContextStart.set();

    // Notify to other clients
    SPELLipcMessage notify( msg );
    notify.setId( ListenerMessages::MSG_CONTEXT_OP );
    notify.setType( MSG_TYPE_ONEWAY );
    notify.set( MessageField::FIELD_CTX_STATUS, MessageValue::DATA_CTX_RUNNING );
    notify.setSender("LST");
    notify.setReceiver("GUI");
    m_gui->displace(&notify);

    // Send notification to peer if any, and if alignment is enabled
    if (m_peer) m_peer->displace(msg);
}
开发者ID:seciltabur,项目名称:spell-sat,代码行数:34,代码来源:SPELLlistenerContext.C

示例3: DEBUG

//=============================================================================
// METHOD    : SPELLcallstack::event_line
//=============================================================================
void SPELLcallstack::event_line( const std::string& file, const int& line, const std::string& name )
{
    DEBUG("[CSTACK] Event line: " + file + ":" + ISTR(line) + ", mode=" + ISTR(m_soMode) + ", so=" + BSTR(isSteppingOver()));

    // If the mark executed flag is set, before changing the current line to the new onee we need to
    // mark the old one as executed. The flag will not be set in case of skip or gotos.
    if (m_markExecuted)
    {
    	// Mark the previous line as executed.
		DEBUG("[CSTACK] Previous line executed");
    	SPELLexecutor::instance().getFrame().getTraceModel(file).markExecuted();
    }
    else
    {
    	// The flag is always kept to value true, unless there is a skip or goto. In that
    	// case, the flag is disabled, so that the line is not notified as executed in this
    	// method, and then the flag is reset to true here so that the next line visited
    	// will be (by default) marked as executed once left.
    	m_markExecuted = true;
    	DEBUG("[CSTACK] Previous line NOT executed");
    }

    // Visit the line
	SPELLexecutor::instance().getFrame().getTraceModel(file).setCurrentLine(line);
    // Add a new line for this event
    m_currentNode->eventLine(line);
    // Update the stack string
    m_stack = std::string(file + ":" + ISTR(line));
    // Update the code name string
    m_codeName = name;

	DEBUG("[CSTACK] Event line notify: " + getStack() + ", mode=" + ISTR(m_soMode) + ", so=" + BSTR(isSteppingOver()));
    SPELLexecutor::instance().getCIF().notifyLine();
}
开发者ID:seciltabur,项目名称:spell-sat,代码行数:37,代码来源:SPELLcallstack.C

示例4: LOG_INFO

//============================================================================
// FUNCTION:    SPELLutils::dumpFrameInfo()
//============================================================================
void SPELLutils::dumpFrameInfo( const std::string& id, PyFrameObject* frame, int iStateId, int TStateId, int FrameId )
{
	LOG_INFO("Dump information for frame " + ISTR(iStateId) + "." + ISTR(TStateId) + "." + ISTR(FrameId));

	std::string dataDir = getSPELL_DATA() + PATH_SEPARATOR + "Runtime" + PATH_SEPARATOR;
	std::string filename = dataDir + id + "_frame_state_" + ISTR(iStateId) + "." + ISTR(TStateId) + "." + ISTR(FrameId) + ".dump";
	std::ofstream dumpFile;
	dumpFile.open( filename.c_str() , std::ios::out );

	dumpFile << "FRAME STATE " << TStateId << " DATA" << std::endl;
	dumpFile << "--------------------------------------" << std::endl;
	dumpFile << "Address              : " << PSTR(frame) << std::endl;
	dumpFile << "Next address         : " << PSTR(frame->f_back) << std::endl;
	dumpFile << "Thread state address : " << PSTR(frame->f_tstate) << std::endl;
	dumpFile << "Last instruction     : " << frame->f_lasti << std::endl;
	dumpFile << "Last line            : " << frame->f_lineno << std::endl;
	dumpFile << "Try blocks count     : " << frame->f_iblock << std::endl;
	dumpFile << "Try blocks           : " << PSTR(frame->f_blockstack) << std::endl;
	dumpFile << "Value stack          : " << PSTR(frame->f_valuestack) << std::endl;
	dumpFile << "Stack top            : " << PSTR(frame->f_stacktop) << std::endl;
	dumpFile << "Stack count          : " << (frame->f_stacktop - frame->f_valuestack) << std::endl;
	dumpFile << "Fast locals          : " << (frame->f_code->co_nlocals-1) << std::endl;
	dumpFile << "Exception type       : " << PYREPR(frame->f_exc_type) << std::endl;
	dumpFile << "Exception value      : " << PYREPR(frame->f_exc_value) << std::endl;
	dumpFile << "Exception traceback  : " << PYREPR(frame->f_exc_traceback) << std::endl;
	dumpFile << "Trace function       : " << PYREPR(frame->f_trace) << std::endl;
	dumpFile << "Builtins             : " << PYSIZE(frame->f_builtins) << std::endl;
	dumpFile << "Globals              : " << PYSIZE(frame->f_globals) << std::endl;
	dumpFile << "Locals               : " << PYSIZE(frame->f_locals) << std::endl;
	dumpFile << "Code                 : " << PYCREPR(frame->f_code) << std::endl;

	// Close the frame state dump, no more to add
	dumpFile.flush();
	dumpFile.close();
}
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:38,代码来源:SPELLutils.C

示例5: toAsRun

//=============================================================================
// METHOD:    SPELLasRun::writePrompt
//=============================================================================
void SPELLasRun::writePrompt( const std::string& stack, const SPELLpromptDefinition& def )
{
    std::string message = def.message;
    SPELLutils::replace( message, "\n", "%C%");
    SPELLutils::replace( message, "\t", "%T%");
    toAsRun( STR("PROMPT") + "\t\t" + stack + "\t" + message + "\t" + ISTR(def.scope), true);

    toAsRun( STR("PROMPT_TYPE") + "\t" + ISTR(def.typecode), false);

    switch(def.typecode)
    {
    case LanguageConstants::PROMPT_OK:
        toAsRun( STR("PROMPT_OPTIONS") + "\tOk", false );
        toAsRun( STR("PROMPT_EXPECTED") + "\tO", false);
        break;
    case LanguageConstants::PROMPT_CANCEL:
        toAsRun( STR("PROMPT_OPTIONS") + "\tCancel", false );
        toAsRun( STR("PROMPT_EXPECTED") + "\tC", false);
        break;
    case LanguageConstants::PROMPT_OK_CANCEL:
        toAsRun( STR("PROMPT_OPTIONS") + "\tOk,,Cancel", false );
        toAsRun( STR("PROMPT_EXPECTED") + "\tO,,C", false);
        break;
    case LanguageConstants::PROMPT_YES:
        toAsRun( STR("PROMPT_OPTIONS") + "\tYes", false );
        toAsRun( STR("PROMPT_EXPECTED") + "\tY", false);
        break;
    case LanguageConstants::PROMPT_NO:
        toAsRun( STR("PROMPT_OPTIONS") + "\tNo", false );
        toAsRun( STR("PROMPT_EXPECTED") + "\tN", false);
        break;
    case LanguageConstants::PROMPT_YES_NO:
        toAsRun( STR("PROMPT_OPTIONS") + "\tYes,,No", false );
        toAsRun( STR("PROMPT_EXPECTED") + "\tY,,N", false);
        break;
    default:
        if ((def.typecode & LanguageConstants::PROMPT_LIST)>0)
        {
        	std::vector<std::string>::const_iterator it;

        	std::string options = "";
        	for( it = def.options.begin(); it != def.options.end(); it++)
        	{
        		if (!options.empty()) options += ",,";
        		options += *it;
        	}
            toAsRun( STR("PROMPT_OPTIONS") + "\t" + options, false);

        	std::string expected = "";
        	for( it = def.expected.begin(); it != def.expected.end(); it++)
        	{
        		if (!expected.empty()) expected += ",,";
        		expected += *it;
        	}
            toAsRun( STR("PROMPT_EXPECTED") + "\t" + expected, false);
        }
    	break;
    }
}
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:62,代码来源:SPELLasRun.C

示例6: SPELLexecutorListener

//=============================================================================
// CONSTRUCTOR: SPELLclientNotifier::SPELLclientNotifier()
//=============================================================================
SPELLclientNotifier::SPELLclientNotifier( SPELLclient* client, SPELLexecutor* exec )
: SPELLexecutorListener(),
  SPELLthread("notifier-" + ISTR(client->getClientKey()) + "-" + exec->getModel().getInstanceId()),
  m_client(client),
  m_exec(exec),
  m_requests(300)
{
	m_id = "notifier-" + ISTR(client->getClientKey()) + "-" + exec->getModel().getInstanceId();
	LOG_INFO("[NOTIF] Created notifier");
	m_exec->registerNotifier( m_id, this );
	m_currentRequest = VOID_MESSAGE;
}
开发者ID:unnch,项目名称:spell-sat,代码行数:15,代码来源:SPELLclientNotifier.C

示例7: complete

//=============================================================================
// METHOD: SPELLutils::timestampUsec
//=============================================================================
std::string SPELLutils::timestampUsec()
{
	const std::string complete("000000");
	SPELLtimeDesc time = getSystemTime();
    std::string sec  = ISTR(time.seconds);
    std::string usec = ISTR(time.useconds);
    if (usec.length()<6)
    {
    	usec += complete.substr(0,6-usec.length());
    }
    return (sec + usec);
}
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:15,代码来源:SPELLutils.C

示例8: complete

//=============================================================================
// METHOD: SPELLserverCif::getTimestampUsec
//=============================================================================
std::string SPELLserverCif::getTimestampUsec()
{
    const std::string complete("000000");
    struct timespec abstime;
    clock_gettime(CLOCK_REALTIME, &abstime);
    std::string sec  = ISTR(abstime.tv_sec);
    std::string usec = ISTR(abstime.tv_nsec/1000);
    if (usec.length()<6)
    {
        usec += complete.substr(0,6-usec.length());
    }
    return (sec + usec);
}
开发者ID:unnch,项目名称:spell-sat,代码行数:16,代码来源:SPELLserverCif.C

示例9: ISTR

//=============================================================================
// METHOD:    SPELLasRun::toAsRun()
//=============================================================================
void SPELLasRun::toAsRun( const std::string& info, bool increaseSequence )
{
    std::string line = SPELLutils::timestamp() + "\t" + ISTR(m_sequence) + "\t" + info;
    m_file << line << std::endl;
    m_file.flush();
    if (increaseSequence) m_sequence++;
}
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:10,代码来源:SPELLasRun.C

示例10: DEBUG

//=============================================================================
// METHOD: SPELLserverCif::error
//=============================================================================
void SPELLserverCif::error( const std::string& msg, unsigned int scope )
{
    if ( getVerbosity() > getVerbosityFilter() ) return;

    DEBUG("[CIF] Error message: " + msg);

    // We shall not bufferize in manual mode
    if (isManual())
    {
        completeMessage( &m_wrMessage );
        std::string timeStr = getTimestampUsec();
        m_wrMessage.set(MessageField::FIELD_TEXT,msg);
        m_wrMessage.set(MessageField::FIELD_LEVEL,MessageValue::DATA_SEVERITY_ERROR);
        m_wrMessage.set(MessageField::FIELD_MSGTYPE,LanguageConstants::DISPLAY);
        m_wrMessage.set(MessageField::FIELD_TIME, timeStr);
        m_wrMessage.set(MessageField::FIELD_SCOPE, ISTR(scope));
        sendGUIMessage(&m_wrMessage);
    }
    else
    {
        m_buffer->error( msg, scope );
    }

    m_asRun->writeError( getStack(), msg, scope );
}
开发者ID:unnch,项目名称:spell-sat,代码行数:28,代码来源:SPELLserverCif.C

示例11: combiner_intr

static void
combiner_intr(void *arg)
{
	struct combiner_softc *sc;
	void (*ih) (void *);
	void *ih_user;
	int enabled;
	int intrs;
	int shift;
	int cirq;
	int grp;
	int i,n;

	sc = arg;

	intrs = READ4(sc, CIPSR);
	for (grp = 0; grp < 32; grp++) {
		if (intrs & (1 << grp)) {
			n = (grp / 4);
			shift = (grp % 4) * 8;

			cirq = READ4(sc, ISTR(n));
			for (i = 0; i < 8; i++) {
				if (cirq & (1 << (i + shift))) {
					ih = intr_map[grp][i].ih;
					ih_user = intr_map[grp][i].ih_user;
					enabled = intr_map[grp][i].enabled;
					if (enabled && (ih != NULL)) {
						ih(ih_user);
					}
				}
			}
		}
	}
}
开发者ID:ele7enxxh,项目名称:dtrace-pf,代码行数:35,代码来源:exynos5_combiner.c

示例12: DEBUG

//=============================================================================
// METHOD: SPELLipcMessageMailbox::retrieve
//=============================================================================
SPELLipcMessage SPELLipcMessageMailbox::retrieve( std::string id, unsigned long timeoutMsec )
{
    DEBUG(NAME + "Retrieve response with id " + id)
    SPELLipcMessageQueue* queue = getQueue(id);

    SPELLipcMessage msg = VOID_MESSAGE;
    try
    {
    	if (timeoutMsec == 0)
    	{
    		msg = queue->pull();
    	}
    	else
    	{
    		msg = queue->pull(timeoutMsec);
    	}
        remove(id);
    }
    catch( SPELLqueueTimeout& timeout )
    {
        //remove(id);
        // Re-throw the exception
        throw SPELLipcError(NAME + "Response timed out (limit " + ISTR(timeoutMsec) + " msec.)", (SPELLerrorCode) IPC_ERROR_TIMEOUT_ECODE);
    }
    DEBUG(NAME + "Retrieve message with id " + id + " done: " + msg.getSequenceStr());
    return msg;
}
开发者ID:unnch,项目名称:spell-sat,代码行数:30,代码来源:SPELLipcMessageMailbox.C

示例13: DEBUG

//=============================================================================
// METHOD    : SPELLbreakpoint::removeBreakpoint()
//=============================================================================
void SPELLbreakpoint::removeBreakpoint( const std::string& file, unsigned int line )
{
	/*
     * REMOVE FROM PERMANENT BREAKPOINTS
     */
	BreakpointMap::iterator it = m_breakpoints.find(file);
	if ( it != m_breakpoints.end())
	{
		// Find the line number and remove it
		BreakpointList::iterator lit;
		for( lit = it->second.begin(); lit != it->second.end(); lit++)
		{
			if (*lit == line)
			{
				DEBUG("[BP] Remove breakpoint at " + file + ":" + ISTR(line) );
				it->second.erase(lit);
				return;
			}
		}
	}
	/*
     * TEMPORARY BREAKPOINTS ARE NOT REMOVED, AS THEY WILL BE REMOVED ONCE
     * THEY ARE REACHED
     */
}
开发者ID:unnch,项目名称:spell-sat,代码行数:28,代码来源:SPELLbreakpoint.C

示例14: DEBUG

//=============================================================================
// METHOD    : SPELLwsWarmStartImpl::saveState()
//=============================================================================
void SPELLwsWarmStartImpl::saveState()
{
	DEBUG("[WS] Saving state ============================================");

	std::cerr << "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" << std::endl;
	std::cerr << "SAVE STATE START" << std::endl;
	std::cerr << "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" << std::endl;

	// Synchronize so that nothing can be done while saving
	SPELLmonitor m(m_lock);

	SPELLsafePythonOperations ops("SPELLwsWarmstartImpl::saveState()");

	//TODO check, possibly there are several states that need to be saved
	PyThreadState* state = m_topFrame->getFrameObject()->f_tstate;
	DEBUG("Current thread state: " + PSTR(state));

	assert(state != NULL);
	// Reset the storage. Remove this if we want the full history, but
	// the load algorith would need to be modified.
	m_storage->reset();
	DEBUG("    - Recursion depth : " + ISTR(state->recursion_depth));
	m_storage->storeLong( state->recursion_depth );
	DEBUG("    - Tick counter    : " + ISTR(state->tick_counter));
	m_storage->storeLong( state->tick_counter );
	DEBUG("    - GIL counter     : " + ISTR(state->gilstate_counter));
	m_storage->storeLong( state->gilstate_counter );
	DEBUG("    - Number of frames: " + ISTR(m_frames.size()));
	m_storage->storeLong( m_frames.size() );

	DEBUG("[WS] Saving frames");
	unsigned int frameCount = m_frames.size();
	for( unsigned int index = 0; index < frameCount; index++)
	{
		std::string id = m_frames[index]->getCodeId();
		DEBUG("   - Saving frame '" + id + "'");
		m_storage->storeObject(SSTRPY(id));
		m_frames[index]->saveState();
	}

	std::cerr << "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" << std::endl;
	std::cerr << "SAVE STATE END" << std::endl;
	std::cerr << "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" << std::endl;

	DEBUG("[WS] Saving state done =======================================");
}
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:49,代码来源:SPELLwsWarmStartImpl.C

示例15: timestamp

//=============================================================================
// METHOD: SPELLserverCif::completeMessage
//=============================================================================
void SPELLserverCif::completeMessage( SPELLipcMessage* msg )
{
    msg->set(MessageField::FIELD_TIME, timestamp() );
    msg->set(MessageField::FIELD_MSG_SEQUENCE, ISTR(m_sequence));
    m_sequence++;

    msg->set(MessageField::FIELD_CSP, getStack() + "/" + ISTR(getNumExecutions()) );

    if (isManual())
    {
        msg->set(MessageField::FIELD_EXECUTION_MODE, MessageValue::DATA_EXEC_MODE_MANUAL);
    }
    else
    {
        msg->set(MessageField::FIELD_EXECUTION_MODE, MessageValue::DATA_EXEC_MODE_PROCEDURE);
    }
}
开发者ID:unnch,项目名称:spell-sat,代码行数:20,代码来源:SPELLserverCif.C


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