Ejemplo n.º 1
0
    // evaluateAsLHS()
    //
    LHSObject *MemberExpression::evaluateAsLHS( Interpreter *interpreter, Scope *scope )
    {

        Instance *instance = getInstance_( interpreter, scope ); // new reference
        if ( !instance )
            return 0; // error already set

        return new LHSMember( instance, memberName_ ); // takes reference
    }
Ejemplo n.º 2
0
  void UniqueIdGenerator::setSeed(UInt64 seed)
  {
  // modifies static members
#ifdef _OPENMP
#pragma omp critical (OPENMS_UniqueIdGenerator_setSeed)
#endif
    {
      UniqueIdGenerator& instance = getInstance_();
      instance.seed_ = seed;
      instance.rng_->seed( instance.seed_ );
      instance.dist_->reset();
    }
  }
Ejemplo n.º 3
0
	// evaluate()
	//
	Object *MemberExpression::evaluate_( Interpreter *interpreter, Scope *scope )
	{

        Instance *instance = getInstance_( interpreter, scope ); // new reference
        if ( !instance )
            return 0; // error already set

		Object *result = instance->getMember( memberName_ ); // new reference

		// clean up
		instance->decRef();

		return result;
	}
Ejemplo n.º 4
0
  UInt64 UniqueIdGenerator::getUniqueId()
  {
    UniqueIdGenerator& instance = getInstance_();
#ifdef _OPENMP
    UInt64 val;
#pragma omp critical (OPENMS_UniqueIdGenerator_getUniqueId)
    {
      val = (*instance.dist_)(*instance.rng_);
    }
    // note: OpenMP can only work on a structured block, return needs to be outside that block
    return val; 
#else
    return (*instance.dist_)(*instance.rng_);
#endif
  }
Ejemplo n.º 5
0
 UInt64 UniqueIdGenerator::getSeed()
 {
   return getInstance_().seed_;
 }