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


C++ RefCountPtr类代码示例

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


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

示例1: THROW_EXCEPTION

METHOD_RETURN_TYPE PDFDictionaryDriver::QueryObject(const ARGS_TYPE& args)
{
    CREATE_ISOLATE_CONTEXT;
	CREATE_ESCAPABLE_SCOPE;
    
    if(args.Length() != 1 || !args[0]->IsString())
    {
		THROW_EXCEPTION("wrong arguments, pass 1 argument which is a string key");
		SET_FUNCTION_RETURN_VALUE(UNDEFINED);
        
    }
    
    std::string key = *String::Utf8Value(args[0]->ToString());

    PDFDictionaryDriver* driver = ObjectWrap::Unwrap<PDFDictionaryDriver>(args.This());
    
    if(!driver->TheObject->Exists(key))
    {
		THROW_EXCEPTION("key not found");
		SET_FUNCTION_RETURN_VALUE(UNDEFINED);
    }
    
    RefCountPtr<PDFObject> anObject = driver->TheObject->QueryDirectObject(key);
    Handle<Value> result = PDFObjectDriver::CreateDriver(anObject.GetPtr());
    
    SET_FUNCTION_RETURN_VALUE(result);
}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:27,代码来源:PDFDictionaryDriver.cpp

示例2: PDFDictionary

PDFObject* PDFObjectParser::ParseDictionary(IPDFParserExtender* inParserExtender)
{
	PDFDictionary* aDictionary = new PDFDictionary();
	bool dictionaryEndEncountered = false;
	std::string token;
	EStatusCode status = PDFHummus::eSuccess;

	while(GetNextToken(token) && PDFHummus::eSuccess == status)
	{
		dictionaryEndEncountered = (scDoubleRightAngle == token);
		if(dictionaryEndEncountered)
			break;

		ReturnTokenToBuffer(token);

		// Parse Key
		PDFObjectCastPtr<PDFName> aKey(ParseNewObject(inParserExtender));
		if(!aKey)
		{
			status = PDFHummus::eFailure;
			TRACE_LOG1("PDFObjectParser::ParseDictionary, failure to parse key for a dictionary. token = %s",token.c_str());
			break;
		}

		// i'll consider duplicate keys as failure
		if(aDictionary->Exists(aKey->GetValue()))
		{
			status = PDFHummus::eFailure;
			TRACE_LOG1("PDFObjectParser::ParseDictionary, failure to parse key for a dictionary, key already exists. key = %s",aKey->GetValue().c_str());
			break;
		}

		// Parse Value
		RefCountPtr<PDFObject> aValue = ParseNewObject(inParserExtender);
		if(!aValue)
		{
			status = PDFHummus::eFailure;
			TRACE_LOG1("PDFObjectParser::ParseDictionary, failure to parse value for a dictionary. token = %s",token.c_str());
			break;
		}
	
		// all well, add the two items to the dictionary
		aDictionary->Insert(aKey.GetPtr(),aValue.GetPtr());
	}

	if(dictionaryEndEncountered && PDFHummus::eSuccess == status)
	{
		return aDictionary;
	}
	else
	{
		delete aDictionary;
		TRACE_LOG1("PDFObjectParser::ParseDictionary, failure to parse dictionary, didn't find end of array or failure to parse dictionary member object. token = %s",token.c_str());
		return NULL;
	}
}
开发者ID:concordusapps,项目名称:PDF-Writer,代码行数:56,代码来源:PDFObjectParser.cpp

示例3: PDFDictionary

PDFObject* PDFObjectParser::ParseDictionary()
{
	PDFDictionary* aDictionary = new PDFDictionary();
	bool dictionaryEndEncountered = false;
	std::string token;
	EStatusCode status = PDFHummus::eSuccess;

	while(GetNextToken(token) && PDFHummus::eSuccess == status)
	{
		dictionaryEndEncountered = (scDoubleRightAngle == token);
		if(dictionaryEndEncountered)
			break;

		ReturnTokenToBuffer(token);

		// Parse Key
		PDFObjectCastPtr<PDFName> aKey(ParseNewObject());
		if(!aKey)
		{
			status = PDFHummus::eFailure;
			TRACE_LOG1("PDFObjectParser::ParseDictionary, failure to parse key for a dictionary. token = %s",token.substr(0, MAX_TRACE_SIZE - 200).c_str());
			break;
		}


		// Parse Value
		RefCountPtr<PDFObject> aValue = ParseNewObject();
		if(!aValue)
		{
			status = PDFHummus::eFailure;
			TRACE_LOG1("PDFObjectParser::ParseDictionary, failure to parse value for a dictionary. token = %s",token.substr(0, MAX_TRACE_SIZE - 200).c_str());
			break;
		}
	

		// all good. i'm gonna be forgiving here and allow skipping duplicate keys. cause it happens
		if(!aDictionary->Exists(aKey->GetValue()))
			aDictionary->Insert(aKey.GetPtr(),aValue.GetPtr());
	}

	if(dictionaryEndEncountered && PDFHummus::eSuccess == status)
	{
		return aDictionary;
	}
	else
	{
		delete aDictionary;
		TRACE_LOG1("PDFObjectParser::ParseDictionary, failure to parse dictionary, didn't find end of array or failure to parse dictionary member object. token = %s",token.substr(0, MAX_TRACE_SIZE - 200).c_str());
		return NULL;
	}
}
开发者ID:KarlHegbloom,项目名称:texmacs,代码行数:51,代码来源:PDFObjectParser.cpp

示例4: matrixFreeEpetraOperator

//-----------------------------------------------------------------------------
// Function      : matrixFreeEpetraOperator
// Purpose       : non-member constructor
// Special Notes :
// Scope         : public
// Creator       : Todd Coffey, 1414
// Creation Date : 9/4/08
//-----------------------------------------------------------------------------
RefCountPtr<MatrixFreeEpetraOperator> matrixFreeEpetraOperator(
    RefCountPtr<NonLinearSolver> nonlinearSolver,
    RefCountPtr<N_LAS_Vector> solVector,
    RefCountPtr<N_LAS_Vector> rhsVector,
    RefCountPtr<const Epetra_Map> solutionMap
    )
{
  RefCountPtr<MatrixFreeEpetraOperator> epetraOperator =
    rcp(new MatrixFreeEpetraOperator);
  epetraOperator->initialize(nonlinearSolver,
      solVector,
      rhsVector,
      solutionMap
      );
  return epetraOperator;
}
开发者ID:Xycedev,项目名称:Xyce,代码行数:24,代码来源:N_NLS_MatrixFreeEpetraOperator.C

示例5: StaticGetCertCallback

void AuthContext::StaticGetCertCallback(AsyncOpPtr theOp, RefCountPtr theParam)
{
	GetCertOp *anOp = (GetCertOp*)theOp.get();

	AuthContext *aContext = (AuthContext*)theParam.get();
	aContext->GetCertCallback(anOp);
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:7,代码来源:AuthContext.cpp

示例6: StaticConnectCallback

void ServerConnection::StaticConnectCallback(AsyncOpPtr theOp, RefCountPtr theParam)
{
	PeerAuthOp *anOp = (PeerAuthOp*)theOp.get();
	ServerConnection *thisConnection = (ServerConnection*)theParam.get();

	thisConnection->ConnectCallback(anOp);
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:7,代码来源:ServerConnection.cpp

示例7: StaticMsgCallback

void ServerConnection::StaticMsgCallback(AsyncOpPtr theOp, RefCountPtr theParam)
{
	RecvMsgOp *anOp = (RecvMsgOp*)theOp.get();
	ServerConnection *thisConnection = (ServerConnection*)theParam.get();

	if(anOp->GetStatus()==WS_Success)
		thisConnection->MsgCallback(anOp->GetMsg());
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:8,代码来源:ServerConnection.cpp

示例8: showXObjectsPerPageInfo

void showXObjectsPerPageInfo(PDFParser& parser,PDFObjectCastPtr<PDFDictionary> xobjects) 
{
    RefCountPtr<PDFName> key;
    PDFObjectCastPtr<PDFIndirectObjectReference> value;
	MapIterator<PDFNameToPDFObjectMap> it = xobjects->GetIterator();
	while(it.MoveNext())
	{
        key = it.GetKey();
        value = it.GetValue();

        cout << "XObject named " << key->GetValue().c_str() << " is object " << value->mObjectID << " of type ";

        PDFObjectCastPtr<PDFStreamInput> xobject(parser.ParseNewObject(value->mObjectID));
        PDFObjectCastPtr<PDFDictionary> xobjectDictionary(xobject->QueryStreamDictionary());
        PDFObjectCastPtr<PDFName> typeOfXObject = xobjectDictionary->QueryDirectObject("Subtype");

        cout << typeOfXObject->GetValue().c_str() << "\n";
    }
}
开发者ID:galkahana,项目名称:PDFWriterSamples,代码行数:19,代码来源:Parsing.cpp

示例9: createSymbTable

SymbolTablePtr createSymbTable(size_t size, SymbolTablePtr parentTable) {
    RefCountPtr<SymbolTable> result;
    switch (size) {
        case 0:
            return parentTable;
        case 1:
            result.reset(new SmallTable<1>(parentTable));
            break;
        case 2:
            result.reset(new SmallTable<2>(parentTable));
            break;
        case 3:
            result.reset(new SmallTable<3>(parentTable));
            break;
        default:
            result.reset(new HashTable(parentTable));
    }
    return result;
}
开发者ID:gkuznets,项目名称:sketch,代码行数:19,代码来源:symbol_table.cpp

示例10: showPageContent

void showPageContent(PDFParser& parser, RefCountPtr<PDFObject> contents, InputFile& pdfFile) 
{
    if(contents->GetType() == ePDFObjectArray) 
	{
        PDFObjectCastPtr<PDFIndirectObjectReference> streamReferences;
		SingleValueContainerIterator<PDFObjectVector> itContents = ((PDFArray*)contents.GetPtr())->GetIterator();
		// array of streams
		while(itContents.MoveNext())
		{
            streamReferences = itContents.GetItem();
            PDFObjectCastPtr<PDFStreamInput> stream = parser.ParseNewObject(streamReferences->mObjectID);
            showContentStream(stream.GetPtr(),pdfFile.GetInputStream(),parser);
        }
    } 
	else 
	{
        // stream
        showContentStream((PDFStreamInput*)contents.GetPtr(),pdfFile.GetInputStream(),parser);
    }
}
开发者ID:galkahana,项目名称:PDFWriterSamples,代码行数:20,代码来源:Parsing.cpp

示例11: PumpTimerCompletion

void GameSpySupport::PumpTimerCompletion(AsyncOpPtr theOp, RefCountPtr theParam)
{
	if (theOp.get()	== NULL)
		return;

	if (theOp->Killed())
		return;

	GameSpySupport *pThat = (GameSpySupport*)theParam.get();
	pThat->Pump();
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:11,代码来源:GameSpySupport.cpp

示例12: ctor

/*----------------------------------------------------------------------*
 |  ctor (public)                                             m.gee 3/06|
 *----------------------------------------------------------------------*/
NLNML::NLNML_ConstrainedMultiLevelOperator::NLNML_ConstrainedMultiLevelOperator(
              RefCountPtr<ML_Epetra::MultiLevelOperator> ml_operator,
              RefCountPtr<NLNML::NLNML_CoarseLevelNoxInterface> coarseinterface,
              bool applyconstraints) :
comm_(ml_operator->Comm()),
coarseinterface_(coarseinterface),
ml_operator_(ml_operator),
applyconstraints_(applyconstraints)
{
  label_ = "NLNML_ConstrainedMultiLevelOperator";
  return;
}
开发者ID:00liujj,项目名称:trilinos,代码行数:15,代码来源:nlnml_ConstrainedMultiLevelOperator.cpp

示例13: EmbedProfile

void JPEGSaver::EmbedProfile(RefCountPtr<CMSProfile> profile)
{
	if(!profile)
		return;
	if(!cinfo)
		throw "JPEGSaver: cinfo already freed!";
	BinaryBlob *blob=profile->GetBlob();
	size_t EmbedLen=blob->GetSize();
	JOCTET *EmbedBuffer=(JOCTET *)blob->GetPointer();
	
	write_icc_profile(cinfo,EmbedBuffer,EmbedLen);
	delete blob;
}
开发者ID:speachy,项目名称:library,代码行数:13,代码来源:jpegsaver.cpp

示例14: ThrowException

Handle<Value> PDFArrayDriver::QueryObject(const Arguments& args)
{
    HandleScope scope;
    
    if(args.Length() != 1 || !args[0]->IsNumber())
    {
		ThrowException(Exception::TypeError(String::New("wrong arguments, pass 1 argument which is an index in the array")));
		return scope.Close(Undefined());
        
    }
    
    PDFArrayDriver* arrayDriver = ObjectWrap::Unwrap<PDFArrayDriver>(args.This());
    if(args[0]->ToNumber()->Uint32Value() >= arrayDriver->TheObject->GetLength())
    {
		ThrowException(Exception::Error(String::New("wrong arguments, pass 1 argument which is a valid index in the array")));
		return scope.Close(Undefined());
    }
    
    RefCountPtr<PDFObject> anObject = arrayDriver->TheObject->QueryObject(args[0]->ToNumber()->Uint32Value());
    Handle<Value> result = PDFObjectDriver::CreateDriver(anObject.GetPtr());
    
    return scope.Close(result);
}
开发者ID:abyr,项目名称:HummusJS,代码行数:23,代码来源:PDFArrayDriver.cpp

示例15: THROW_EXCEPTION

METHOD_RETURN_TYPE PDFArrayDriver::QueryObject(const ARGS_TYPE& args)
{
    CREATE_ISOLATE_CONTEXT;
	CREATE_ESCAPABLE_SCOPE;
    
    if(args.Length() != 1 || !args[0]->IsNumber())
    {
		THROW_EXCEPTION("wrong arguments, pass 1 argument which is an index in the array");
		SET_FUNCTION_RETURN_VALUE(UNDEFINED);
        
    }
    
    PDFArrayDriver* arrayDriver = ObjectWrap::Unwrap<PDFArrayDriver>(args.This());
    if(args[0]->ToNumber()->Uint32Value() >= arrayDriver->TheObject->GetLength())
    {
		THROW_EXCEPTION("wrong arguments, pass 1 argument which is a valid index in the array");
		SET_FUNCTION_RETURN_VALUE(UNDEFINED);
    }
    
    RefCountPtr<PDFObject> anObject = arrayDriver->TheObject->QueryObject(args[0]->ToNumber()->Uint32Value());
    Handle<Value> result = PDFObjectDriver::CreateDriver(anObject.GetPtr());
    
    SET_FUNCTION_RETURN_VALUE(result);
}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:24,代码来源:PDFArrayDriver.cpp


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