Beispiel #1
0
void KVClassFactory::AddAllBaseConstructors()
{
    // Add constructors with the same signature as all base class constructors
    // (apart from the default ctor or any copy constructors, which are a special case)
    // By default, all constructors are 'public'.

    if(!fBaseClass) return;

    KVHashList clist;
    clist.AddAll(fBaseClass->GetListOfMethods());
    KVSeqCollection* constructors = clist.GetSubListWithName(fBaseClassName);
    TIter next_ctor(constructors);
    TMethod* method;
    while( (method = (TMethod*)next_ctor()) )
    {
        if(!method->GetNargs()) continue; // ignore default ctor
        TList* args = method->GetListOfMethodArgs();
        TMethodArg* arg = (TMethodArg*)args->First();
        TString typenam=arg->GetFullTypeName();
        if(typenam.Contains(fBaseClassName)) continue; // ignore copy ctor
        KVClassMethod* ctor;
        if(arg->GetDefault()) ctor = AddConstructor( typenam, arg->GetName(), arg->GetDefault() );
        else ctor = AddConstructor(typenam, arg->GetName());
        for(int i=1; i<method->GetNargs(); i++){
            arg = (TMethodArg*)args->At(i);
            if(arg->GetDefault()) ctor->AddArgument( arg->GetFullTypeName(), arg->GetName(), arg->GetDefault() );
            else ctor->AddArgument(arg->GetFullTypeName(), arg->GetName());
        }
    }

    delete constructors;
}
Beispiel #2
0
unsigned CScheduler::Dispatch()
{
	try
	{
		while( true )
		{
			if( !m_activeQueue.empty() )
			{
				TMethod job;
				{
					//TODO add critical section
					CCritSection lock( &m_cs );
					job = m_activeQueue.front();
					m_activeQueue.pop();
				}
				job->callMethod();
			}
			if( WaitForSingleObject( m_hStopEvent.get() , 2 ) == WAIT_OBJECT_0 )
				return 0;
		}
	}
	catch( CStreamException& ex )
	{
		Log.Add(_MESSAGE_,ex.What().c_str())	;	
	}
	return 0;
}
void runCintexReflexOrder() {
   gSystem->Setenv("LINES","-1");
   gSystem->Load("libCintex");
   gSystem->Load("libReflexDict");
   ROOT::Cintex::Cintex::Enable();
   TClass* cl = TClass::GetClass("Reflex::Scope");
   TMethod* m = (TMethod*) cl->GetListOfMethods()->FindObject("AddMemberTemplate");
   TMethodArg* arg = (TMethodArg*) m->GetListOfMethodArgs()->First();
   cout << "AddMemberTemplate() arg0: " << arg->GetFullTypeName() << endl;
}