當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetIdent函數代碼示例

本文整理匯總了C++中GetIdent函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetIdent函數的具體用法?C++ GetIdent怎麽用?C++ GetIdent使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetIdent函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: _TRACE

void CStatement::Action(const CDbapiEvent& e)
{
    _TRACE(GetIdent() << " " << (void*)this << ": '" << e.GetName()
           << "' received from " << e.GetSource()->GetIdent());

    CResultSet *rs;

    if (dynamic_cast<const CDbapiFetchCompletedEvent*>(&e) != 0 ) {
        if( m_irs != 0 && (rs = dynamic_cast<CResultSet*>(e.GetSource())) != 0 ) {
            if( rs == m_irs ) {
                m_rowCount = rs->GetTotalRows();
                _TRACE("Rowcount from the last resultset: " << m_rowCount);
            }
        }
    }

    if (dynamic_cast<const CDbapiDeletedEvent*>(&e) != 0 ) {
        RemoveListener(e.GetSource());
        if(dynamic_cast<CConnection*>(e.GetSource()) != 0 ) {
            _TRACE("Deleting " << GetIdent() << " " << (void*)this);
            delete this;
        }
        else if( m_irs != 0 && (rs = dynamic_cast<CResultSet*>(e.GetSource())) != 0 ) {
            if( rs == m_irs ) {
                _TRACE("Clearing cached CResultSet " << (void*)m_irs);
                m_irs = 0;
            }
        }
    }
}
開發者ID:swuecho,項目名稱:igblast,代碼行數:30,代碼來源:stmt_impl.cpp

示例2: assert

  //-----------------------------------------------------------------------------------------------
  void OprtSubCmplx::Eval(ptr_val_type &ret, const ptr_val_type *a_pArg, int num)
  { 
    assert(num==2);
    
    const IValue *arg1 = a_pArg[0].Get();
    const IValue *arg2 = a_pArg[1].Get();
    if ( a_pArg[0]->IsNonComplexScalar() && a_pArg[1]->IsNonComplexScalar())
    {
      *ret = arg1->GetFloat() - arg2->GetFloat(); 
    }
    else if (a_pArg[0]->GetType()=='m' && a_pArg[1]->GetType()=='m')
    {
      // Matrix + Matrix
      *ret = arg1->GetArray() - arg2->GetArray();
    }
    else
    {
      if (!a_pArg[0]->IsScalar())
        throw ParserError( ErrorContext(ecTYPE_CONFLICT_FUN, GetExprPos(), GetIdent(), a_pArg[0]->GetType(), 'c', 1)); 

      if (!a_pArg[1]->IsScalar())
        throw ParserError( ErrorContext(ecTYPE_CONFLICT_FUN, GetExprPos(), GetIdent(), a_pArg[1]->GetType(), 'c', 2)); 
      
      *ret = cmplx_type(a_pArg[0]->GetFloat() - a_pArg[1]->GetFloat(),
                        a_pArg[0]->GetImag() - a_pArg[1]->GetImag()); 
    }
  }
開發者ID:boussaffawalid,項目名稱:OTB,代碼行數:28,代碼來源:mpOprtCmplx.cpp

示例3: _TRACE

void CResultSet::Action(const CDbapiEvent& e)
{
    _TRACE(GetIdent() << " " << (void*)this
              << ": '" << e.GetName()
              << "' received from " << e.GetSource()->GetIdent());

    if(dynamic_cast<const CDbapiClosedEvent*>(&e) != 0 ) {
        if( dynamic_cast<CStatement*>(e.GetSource()) != 0
            || dynamic_cast<CCallableStatement*>(e.GetSource()) != 0 ) {
            if( m_rs != 0 ) {
                _TRACE("Discarding old CDB_Result " << (void*)m_rs);
                Invalidate();
            }
        }
    }
    else if(dynamic_cast<const CDbapiDeletedEvent*>(&e) != 0 ) {

        RemoveListener(e.GetSource());

        if(dynamic_cast<CStatement*>(e.GetSource()) != 0
           || dynamic_cast<CCursor*>(e.GetSource()) != 0
           || dynamic_cast<CCallableStatement*>(e.GetSource()) != 0 ) {
            _TRACE("Deleting " << GetIdent() << " " << (void*)this);
            delete this;
        }
    }
}
開發者ID:swuecho,項目名稱:igblast,代碼行數:27,代碼來源:rs_impl.cpp

示例4: GetIdent

  /** \brief Return the value as an integer. 
    
    This function should only be called if you really need an integer value and
    want to make sure your either get one or throw an exception if the value
    can not be implicitely converted into an integer.
  */
  int_type Value::GetInteger() const
  {
    float_type v = m_val.real();

    if (m_cType!='i') //!IsScalar() || (int_type)v-v!=0)
    {
      ErrorContext err;
      err.Errc  = ecTYPE_CONFLICT;
      err.Type1 = m_cType;
      err.Type2 = 'i';
      
      if (GetIdent().length())
      {
        err.Ident = GetIdent();
      }
      else
      {
        stringstream_type ss;
        ss << *this;
        err.Ident = ss.str();
      }

      throw ParserError(err);
    }

    return (int_type)v;
  }
開發者ID:boussaffawalid,項目名稱:OTB,代碼行數:33,代碼來源:mpValue.cpp

示例5: indices

  /** \brief Index operator implementation
      \param ret A reference to the return value
      \param a_pArg Pointer to an array with the indices as ptr_val_type
      \param a_iArgc Number of indices (=dimension) actully used in the expression found. This must 
             be 1 or 2 since three dimensional data structures are not supported by muParserX.
  */
  void OprtIndex::At(ptr_val_type &ret, const ptr_val_type *a_pArg, int a_iArgc)
  {
    try
    {
      // The index is -1, thats the actual variable reference
      if (a_iArgc!=a_pArg[-1]->GetDim())
      {
        throw ParserError(ErrorContext(ecINDEX_DIMENSION, -1, GetIdent()));
      }

      switch(a_iArgc)
      {
      case 1:
          ret.Reset(new Variable( &(ret->At(*a_pArg[0], Value(0))) ) );
          break;

      case 2:
          ret.Reset(new Variable( &(ret->At(*a_pArg[0], *a_pArg[1])) ) );
          break;

      default:
          throw ParserError(ErrorContext(ecINDEX_DIMENSION, -1, GetIdent()));
      }
    }
    catch(ParserError &exc)
    {
      exc.GetContext().Pos = GetExprPos();
      throw exc;
    }
  }
開發者ID:QAndot,項目名稱:muparser,代碼行數:36,代碼來源:mpOprtIndex.cpp

示例6: LookupIdent

static SymPtr LookupIdent(char **name)
{
	SymPtr sym=NULL,parent;
	
    /* check this class only */
	if( in_class && Token==tSELF )
	{
		SkipToken(tSELF);
		SkipToken(tPERIOD);
		*name = GetIdent();
		sym = SymFindLevel(*name,(SymGetScope()-1));
	}
    /* check super class only */
	else if( in_class && Token==tSUPER && base_class->super!=NULL )
	{
	    SkipToken(tSUPER);
	    SkipToken(tPERIOD);
	    *name = GetIdent();
	    sym = SymFindLocal(*name,base_class->super);
        
	    if( sym!=NULL && sym->flags&SYM_PRIVATE )
	    {
		    compileError("attempt to access private field '%s'",*name);
		    NextToken();
		    return COMPILE_ERROR;
	    }
	}
	/* check all super classes */
    else if( in_class )
	{
        *name = GetIdent();
        parent=base_class->super;
        while(parent!=NULL)
        {
            sym = SymFindLocal(*name,parent);
            if(sym!=NULL) break;
            parent=parent->super;
        }
	   	if( sym!=NULL && sym->flags&SYM_PRIVATE )
	    {
		    compileError("attempt to access private field '%s'",*name);
		    NextToken();
		    return COMPILE_ERROR;
	    }
	}
    
    /* check globals */
    if( sym==NULL )
	{
		*name = GetIdent();
		sym = SymFind(*name);
	}
    
	return sym;
}
開發者ID:markcheno,項目名稱:topaz,代碼行數:55,代碼來源:parser.c

示例7: assert

  /** \brief Implements the Division operator. 
      \throw ParserError in case one of the arguments if 
             nonnumeric or an array.
  
  */
  void OprtDiv::Eval(ptr_val_type &ret, const ptr_val_type *a_pArg, int num)
  { 
    assert(num==2);

    if (!a_pArg[0]->IsNonComplexScalar())
      throw ParserError( ErrorContext(ecTYPE_CONFLICT_FUN, -1, GetIdent(), a_pArg[0]->GetType(), 'f', 1)); 

    if (!a_pArg[1]->IsNonComplexScalar())
      throw ParserError( ErrorContext(ecTYPE_CONFLICT_FUN, -1, GetIdent(), a_pArg[1]->GetType(), 'f', 2)); 
    
    *ret = a_pArg[0]->GetFloat() / a_pArg[1]->GetFloat();
  }
開發者ID:QAndot,項目名稱:muparser,代碼行數:17,代碼來源:mpOprtNonCmplx.cpp

示例8: _TRACE

void CDBAPIBulkInsert::Action(const CDbapiEvent& e) 
{
    _TRACE(GetIdent() << " " << (void*)this << ": '" << e.GetName() 
           << "' from " << e.GetSource()->GetIdent());

    if(dynamic_cast<const CDbapiDeletedEvent*>(&e) != 0 ) {
	RemoveListener(e.GetSource());
        if(dynamic_cast<CConnection*>(e.GetSource()) != 0 ) {
            _TRACE("Deleting " << GetIdent() << " " << (void*)this); 
            delete this;
        }
    }
}
開發者ID:DmitrySigaev,項目名稱:ncbi,代碼行數:13,代碼來源:bulkinsert.cpp

示例9: ParserError

  //------------------------------------------------------------------------------
  void FunMax::Eval(ptr_val_type &ret, const ptr_val_type *a_pArg, int a_iArgc)
  {
	  if (a_iArgc < 1)
		throw ParserError(ErrorContext(ecTOO_FEW_PARAMS, GetExprPos(), GetIdent()));

	float_type smax(-1e30), sval(0);
	for (int i=0; i<a_iArgc; ++i)
	{
	  switch(a_pArg[i]->GetType())
	  {
	  case 'f': sval = a_pArg[i]->GetFloat();   break;
	  case 'i': sval = a_pArg[i]->GetFloat(); break;
	  case 'n': break; // ignore not in list entries (missing parameter)
	  case 'c':
	  default:
		{
		  ErrorContext err;
		  err.Errc = ecTYPE_CONFLICT_FUN;
		  err.Arg = i+1;
		  err.Type1 = a_pArg[i]->GetType();
		  err.Type2 = 'f';
		  throw ParserError(err);
		}
	  }
	  smax = max(smax, sval);
	}

	*ret = smax;
  }
開發者ID:shadeMe,項目名稱:BGSEditorExtenderBase,代碼行數:30,代碼來源:mpFuncCommon.cpp

示例10: time

CString& CUser::ExpandString(const CString& sStr, CString& sRet) const {
	// offset is in hours, so * 60 * 60 gets us seconds
	time_t iUserTime = time(NULL) + (time_t)(m_fTimezoneOffset * 60 * 60);
	char *szTime = ctime(&iUserTime);
	CString sTime;

	if (szTime) {
		sTime = szTime;
		// ctime() adds a trailing newline
		sTime.Trim();
	}

	sRet = sStr;
	sRet.Replace("%user%", GetUserName());
	sRet.Replace("%defnick%", GetNick());
	sRet.Replace("%nick%", GetNick());
	sRet.Replace("%altnick%", GetAltNick());
	sRet.Replace("%ident%", GetIdent());
	sRet.Replace("%realname%", GetRealName());
	sRet.Replace("%vhost%", GetBindHost());
	sRet.Replace("%bindhost%", GetBindHost());
	sRet.Replace("%version%", CZNC::GetVersion());
	sRet.Replace("%time%", sTime);
	sRet.Replace("%uptime%", CZNC::Get().GetUptime());
	// The following lines do not exist. You must be on DrUgS!
	sRet.Replace("%znc%", "All your IRC are belong to ZNC");
	// Chosen by fair zocchihedron dice roll by SilverLeo
	sRet.Replace("%rand%", "42");

	return sRet;
}
開發者ID:b3rend,項目名稱:znc,代碼行數:31,代碼來源:User.cpp

示例11: GetCode

//-----------------------------------------------------------------------------------------------
string_type Variable::AsciiDump() const
{
    stringstream_type ss;

    ss << g_sCmdCode[ GetCode() ];
    ss << _T(" [addr=0x") << std::hex << this << std::dec;
    ss << _T("; id=\"") << GetIdent() << _T("\"");
    ss << _T("; type=\"") << GetType() << _T("\"");
    ss << _T("; val=");

    switch(GetType())
    {
    case 'i':
        ss << (int_type)GetFloat();
        break;
    case 'f':
        ss << GetFloat();
        break;
    case 'm':
        ss << _T("(array)");
        break;
    case 's':
        ss << _T("\"") << GetString() << _T("\"");
        break;
    }

    ss << ((IsFlagSet(IToken::flVOLATILE)) ? _T("; ") : _T("; not ")) << _T("volatile");
    ss << _T("]");

    return ss.str();
}
開發者ID:QwZhang,項目名稱:gale,代碼行數:32,代碼來源:mpVariable.cpp

示例12: ParserError

/** \brief Verify the operator prototype.

  Binary operators have the additional constraint that return type and the types
  of both arguments must be the same. So adding to floats can not produce a string
  and adding a number to a string is impossible.
*/
void IOprtBin::CheckPrototype(const string_type &a_sProt)
{
    if (a_sProt.length()!=4)
        throw ParserError( ErrorContext(ecAPI_INVALID_PROTOTYPE, -1, GetIdent() ) );

    //if (a_sProt[0]!=a_sProt[2] || a_sProt[0]!=a_sProt[3])
    //  throw ParserError( ErrorContext(ecAPI_INVALID_PROTOTYPE, -1, GetIdent() ) );
}
開發者ID:QAndot,項目名稱:muparser,代碼行數:14,代碼來源:mpIOprt.cpp

示例13: _TRACE

void CConnection::Action(const CDbapiEvent& e)
{
    _TRACE(GetIdent() << " " << (void*)this << ": '" << e.GetName()
        << "' received from " << e.GetSource()->GetIdent() << " " << (void*)e.GetSource());

    if(dynamic_cast<const CDbapiClosedEvent*>(&e) != 0 ) {
/*
        CStatement *stmt;
        CCallableStatement *cstmt;
        CCursor *cursor;
        CDBAPIBulkInsert *bulkInsert;
        if( (cstmt = dynamic_cast<CCallableStatement*>(e.GetSource())) != 0 ) {
            if( cstmt == m_cstmt ) {
                _TRACE("CConnection: Clearing cached callable statement " << (void*)m_cstmt);
                m_cstmt = 0;
            }
        }
        else if( (stmt = dynamic_cast<CStatement*>(e.GetSource())) != 0 ) {
            if( stmt == m_stmt ) {
                _TRACE("CConnection: Clearing cached statement " << (void*)m_stmt);
                m_stmt = 0;
            }
        }
        else if( (cursor = dynamic_cast<CCursor*>(e.GetSource())) != 0 ) {
            if( cursor == m_cursor ) {
                _TRACE("CConnection: Clearing cached cursor " << (void*)m_cursor);
                m_cursor = 0;
            }
        }
        else if( (bulkInsert = dynamic_cast<CDBAPIBulkInsert*>(e.GetSource())) != 0 ) {
            if( bulkInsert == m_bulkInsert ) {
                _TRACE("CConnection: Clearing cached bulkinsert " << (void*)m_bulkInsert);
                m_bulkInsert = 0;
            }
        }
*/
        if( m_connCounter == 1 )
            m_connUsed = false;
    }
    else if(dynamic_cast<const CDbapiAuxDeletedEvent*>(&e) != 0 ) {
        if( m_connCounter > 1 ) {
            --m_connCounter;
            _TRACE("Server: " << GetCDB_Connection()->ServerName()
                   <<", connections left: " << m_connCounter);
        }
        else
            m_connUsed = false;
    }
    else if(dynamic_cast<const CDbapiDeletedEvent*>(&e) != 0 ) {
        RemoveListener(e.GetSource());
        if(dynamic_cast<CDataSource*>(e.GetSource()) != 0 ) {
            if( m_ownership == eNoOwnership ) {
                delete this;
            }
        }
    }
}
開發者ID:svn2github,項目名稱:ncbi_tk,代碼行數:57,代碼來源:conn_impl.cpp

示例14: SkipWhiteSpace

Token* Tokenizer::GetNext() {
  Token* T = NULL;

  // First check to see if there is an UnGetToken. If there is, use it.
  if (UnGetToken != NULL) {
    T = UnGetToken;
    UnGetToken = NULL;
    return T;
  }

  // Otherwise, crank up the scanner and get a new token.

  // Get rid of any whitespace
  SkipWhiteSpace();

  // test for end of file
  if (buffer.isEOF()) {
    T = new Token(EOFSYM);

  } else {
    
    // Save the starting position of the symbol in a variable,
    // so that nicer error messages can be produced.
    TokenColumn = buffer.CurColumn();
    
    // Check kind of current character
    
    // Note that _'s are now allowed in identifiers.
    if (isalpha(CurrentCh) || '_' == CurrentCh) {
      // grab identifier or reserved word
      T = GetIdent();
    } else if ( '"' == CurrentCh)  {
      T = GetQuotedIdent(); 
    } else if (isdigit(CurrentCh) || '-' == CurrentCh || '.' == CurrentCh) {
      T = GetScalar();
    } else { 
      //
      // Check for other tokens
      //
      
      T = GetPunct();
    }
  }
  
  if (T == NULL) {
    throw ParserFatalException("didn't get a token");
  }

  if (_printTokens) {
    std::cout << "Token read: ";
    T->Print();
    std::cout << std::endl;
  }

  return T;
}
開發者ID:shayne1993,項目名稱:ComputerGraphicProjects,代碼行數:56,代碼來源:Tokenizer.cpp

示例15: Notify

CResultSet::~CResultSet()
{
    try {
        Notify(CDbapiClosedEvent(this));
        FreeResources();
        Notify(CDbapiDeletedEvent(this));
        _TRACE(GetIdent() << " " << (void*)this << " deleted.");
    }
    NCBI_CATCH_ALL_X( 6, kEmptyStr )
}
開發者ID:swuecho,項目名稱:igblast,代碼行數:10,代碼來源:rs_impl.cpp


注:本文中的GetIdent函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。