Esempio n. 1
0
/* static */
already_AddRefed<URLMainThread> URLMainThread::Constructor(
    const GlobalObject& aGlobal, const nsAString& aURL,
    const Optional<nsAString>& aBase, ErrorResult& aRv) {
  if (aBase.WasPassed()) {
    return Constructor(aGlobal.GetAsSupports(), aURL, aBase.Value(), aRv);
  }

  return Constructor(aGlobal.GetAsSupports(), aURL, nullptr, aRv);
}
 container_loader( OutIterator outIter_, 
                   Constructor constructor_ = Constructor(),
                   Policy      policy_ = Policy() ) :
     outIter(outIter_),
     constructor(constructor_),
     policy(policy_)
 {}
void S626_OpenBoard( HBD hbd, DWORD PhysLoc, FPTR_ISR Callback, DWORD Priority )
{
    if( S626_VerifyTypes() != 0) {
        printf("warning: possible types problem");
    }
	// Abort if a valid board handle is not specified.
	if ( hbd >= MAX_BOARDS )
		return;

	// Increase counts of opening boards.
	open_boards ++;

	// Destroy any object that is currently occupying the board handle.
	Destructor( hbd );		// including: Close the board if it is open at CORE level, using S626CORE_BoardClose( hbd );

	// Open CORE object for board open preparation.
	if ( !S626CORE_CoreOpen( hbd, open_boards ) ) 
	{
		S626CORE_SetErrors( hbd, ERR_OPEN );
		return;
	}

	// Attempt to open the board.
	Constructor( hbd, PhysLoc, Callback, Priority, 0 );	// including: Open the board at CORE level, using S626CORE_BoardOpen( hbd, IsBoardRevA );

	//if ( S626CORE_GetErrors( HBD bd ) & ( ERR_OPEN | ERR_CARDREG | ERR_ALLOC_MEMORY | ERR_LOCK_BUFFER | ERR_THREAD | ERR_INTERRUPT ) )
	//printf("error message: ? \n");
	
}
Esempio n. 4
0
SAMinimizer::SAMinimizer(Random & r) :
   GeneralMinimizer(), y(), simplex(), psum(), ptry()
   {
   freeRand = false;
   rand = &r;

   Constructor();
   }
Esempio n. 5
0
/* static */ already_AddRefed<URLMainThread>
URLMainThread::Constructor(const GlobalObject& aGlobal, const nsAString& aURL,
                           URL& aBase, ErrorResult& aRv)
{
  MOZ_ASSERT(NS_IsMainThread());
  URLMainThread& base = static_cast<URLMainThread&>(aBase);
  return Constructor(aGlobal.GetAsSupports(), aURL, base.GetURI(), aRv);
}
Esempio n. 6
0
// static
already_AddRefed<PointerEvent>
PointerEvent::Constructor(const GlobalObject& aGlobal,
                          const nsAString& aType,
                          const PointerEventInit& aParam,
                          ErrorResult& aRv)
{
  nsCOMPtr<EventTarget> owner = do_QueryInterface(aGlobal.GetAsSupports());
  return Constructor(owner, aType, aParam);
}
Esempio n. 7
0
SAMinimizer::SAMinimizer() :
   GeneralMinimizer(), y(), simplex(), psum(), ptry()
   {
   time_t t;
   rand = new Random((long)time(&t));
   freeRand = true;

   Constructor();
   }
Esempio n. 8
0
/* static */ already_AddRefed<MessageEvent>
MessageEvent::Constructor(const GlobalObject& aGlobal,
                          const nsAString& aType,
                          const MessageEventInit& aParam,
                          ErrorResult& aRv)
{
  nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
  return Constructor(t, aType, aParam, aRv);
}
Esempio n. 9
0
Constructor::Constructor(int i)
{
   Constructor();
   if(i != 0)
   {
      this->m_i = i;
   }

   cout << this->m_i << endl;
}
Esempio n. 10
0
already_AddRefed<LabeledBlob> 
LabeledBlob::Constructor(const GlobalObject& global,
                         JSContext* cx,
                         const nsAString& blob,
                         const nsAString& privacy,
                         ErrorResult& aRv)
{
  nsRefPtr<Label> lprivacy = Label::Constructor(global, privacy, aRv);
  if (aRv.Failed()) return nullptr;
  return Constructor(global, cx, blob, *lprivacy, aRv);
}
 container_serializer( InIterator    firstIter_,
                       InIterator    endIter_,
                       OutIterator   outIter_,
                       Constructor   constructor_ = Constructor(),
                       Policy        policy_ = Policy() ) :
     firstIter(firstIter_),
     endIter(endIter_),
     outIter(outIter_),
     constructor(constructor_),
     policy(policy_)
 {}
Esempio n. 12
0
/* static */
already_AddRefed<URLMainThread> URLMainThread::Constructor(
    nsISupports* aParent, const nsAString& aURL, const nsAString& aBase,
    ErrorResult& aRv) {
  MOZ_ASSERT(NS_IsMainThread());

  nsCOMPtr<nsIURI> baseUri;
  nsresult rv = NS_NewURI(getter_AddRefs(baseUri), aBase, nullptr, nullptr,
                          nsContentUtils::GetIOService());
  if (NS_WARN_IF(NS_FAILED(rv))) {
    aRv.ThrowTypeError<MSG_INVALID_URL>(aBase);
    return nullptr;
  }

  return Constructor(aParent, aURL, baseUri, aRv);
}
Esempio n. 13
0
void SaslServer::mechanisms(const std::string& mechanisms)
{
    void* frameToken = startFrame();

    std::vector<std::string> parts = split(mechanisms, SPACE);
    void* listToken = encoder.startList32(&SASL_MECHANISMS);
    if (parts.size() > 1) {
        void* arrayToken = encoder.startArray8(Constructor(SYMBOL8));
        for (std::vector<std::string>::const_iterator i = parts.begin();i != parts.end(); ++i) {
            uint8_t size = i->size() > std::numeric_limits<uint8_t>::max() ? std::numeric_limits<uint8_t>::max() : i->size();
            encoder.write(size);
            encoder.writeBytes(i->data(), size);
        }
        encoder.endArray8(parts.size(), arrayToken);
    } else {
        encoder.writeSymbol(mechanisms);
    }
    encoder.endList32(1, listToken);

    endFrame(frameToken);
    QPID_LOG_CAT(debug, protocol, id << " Sent SASL-MECHANISMS(" << mechanisms << ") " << encoder.getPosition());
}
	void testConcurrentConstruction()
	{
		size_t numIterations = 10000000;
		parallel_for( blocked_range<size_t>( 0, numIterations ), Constructor() );
	}
Esempio n. 15
0
BRUSH* ConvertXModelToBrushFormat ( char* szFilename, BRUSH* pBrush, int* piCount, LPDIRECT3DDEVICE8 lpDevice )
{
	// takes an x model and converts it into brushes

	// check the pointers are valid
	if ( !szFilename || !piCount )
		return NULL;

	// used to access vertex data
	struct sMeshData
	{
		float x, y, z;
		float nx, ny, nz;
		float tu, tv;
	};

	// variable declarations
	tagModelData*			ptr;				// model data
	LPDIRECT3DVERTEXBUFFER8 pMeshVertexBuffer;	// vertex buffer
	LPDIRECT3DINDEXBUFFER8  pMeshIndexBuffer;	// index buffer
	sMeshData*				pMeshVertices;		// mesh vertices
	WORD*					pMeshIndices;		// mesh indices
	sMesh*					pMesh;				// mesh data
	int						iCount;
	
	// load the model
	Constructor ( lpDevice );
	ptr = Load ( 1, szFilename );

	pMesh = ptr->m_Object.m_Meshes;

	// count the number of brushes so we can allocate enough memory for them
	iCount = 0;

	while ( pMesh )
	{
		pMesh = pMesh->m_Next;
		iCount++;
	}

	// store the number of models in the brush count pointer
	*piCount = iCount;

	// now setup the brushes
	pBrush = new BRUSH [ iCount ];	// allocate memory
	
	// set the mesh pointer back to the original mesh
	pMesh = ptr->m_Object.m_Meshes;

	// run through all meshes and store the brush data
	// first off set iCount to 0 so we know which brush
	// we are dealing with
	iCount = 0;

	while ( pMesh )
	{
		int   iInd          = 0;
		DWORD dwNumVertices = pMesh->m_Mesh->GetNumVertices ( );
		DWORD dwNumFaces	= pMesh->m_Mesh->GetNumFaces ( );

		pBrush [ iCount ].Faces      = new POLYGON [ dwNumFaces ];
		pBrush [ iCount ].FaceCount  = dwNumFaces;
		pBrush [ iCount ].Bounds.Max = D3DXVECTOR3 (  150.0f,  150.0f,  150.0f );
		pBrush [ iCount ].Bounds.Min = D3DXVECTOR3 ( -150.0f, -150.0f, -150.0f );
		pBrush [ iCount ].BSPTree    = NULL;

		pMesh->m_Mesh->GetVertexBuffer ( &pMeshVertexBuffer );
		pMesh->m_Mesh->GetIndexBuffer  ( &pMeshIndexBuffer );

		DWORD dwFVF = pMesh->m_Mesh->GetFVF ( );

		pMeshVertexBuffer->Lock ( 0, pMesh->m_Mesh->GetNumVertices  ( ) * sizeof ( sMeshData ), ( BYTE** ) &pMeshVertices, 0 );
		pMeshIndexBuffer->Lock  ( 0, 3 * pMesh->m_Mesh->GetNumFaces ( ) * sizeof ( WORD ),      ( BYTE** ) &pMeshIndices,  0 );
	
		for ( int iTemp = 0; iTemp < dwNumFaces; iTemp++ )
		{
			char szX [ 256 ];
			char szY [ 256 ];
			char szZ [ 256 ];

			int iA = pMeshIndices [ iInd + 0 ];
			int iB = pMeshIndices [ iInd + 1 ];
			int iC = pMeshIndices [ iInd + 2 ];

			WORD wIndices [ ] = { 0, 1, 2 };
			
			pBrush [ iCount ].Faces [ iTemp ].IndexCount   = 3;
			pBrush [ iCount ].Faces [ iTemp ].TextureIndex = 0;
			pBrush [ iCount ].Faces [ iTemp ].VertexCount  = 3;
			pBrush [ iCount ].Faces [ iTemp ].Indices      = new WORD      [ 3 ];
			pBrush [ iCount ].Faces [ iTemp ].Vertices     = new D3DVERTEX [ 3 ];

			pBrush [ iCount ].Faces [ iTemp ].Vertices [ 0 ] = SetupVertex ( pMeshVertices [ iA ].x, pMeshVertices [ iA ].y, pMeshVertices [ iA ].z, pMeshVertices [ iA ].tu, pMeshVertices [ iA ].tv );
			pBrush [ iCount ].Faces [ iTemp ].Vertices [ 1 ] = SetupVertex ( pMeshVertices [ iB ].x, pMeshVertices [ iB ].y, pMeshVertices [ iB ].z, pMeshVertices [ iB ].tu, pMeshVertices [ iB ].tv );
			pBrush [ iCount ].Faces [ iTemp ].Vertices [ 2 ] = SetupVertex ( pMeshVertices [ iC ].x, pMeshVertices [ iC ].y, pMeshVertices [ iC ].z, pMeshVertices [ iC ].tu, pMeshVertices [ iC ].tv );

			for ( int iChar = 0; iChar < 3; iChar++ )
			{
				sprintf ( szX, "%.1f", pBrush [ iCount ].Faces [ iTemp ].Vertices [ iChar ].x );
				sprintf ( szY, "%.1f", pBrush [ iCount ].Faces [ iTemp ].Vertices [ iChar ].y );
				sprintf ( szZ, "%.1f", pBrush [ iCount ].Faces [ iTemp ].Vertices [ iChar ].z );

				pBrush [ iCount ].Faces [ iTemp ].Vertices [ iChar ].x = atof ( szX );
				pBrush [ iCount ].Faces [ iTemp ].Vertices [ iChar ].y = atof ( szY );
				pBrush [ iCount ].Faces [ iTemp ].Vertices [ iChar ].z = atof ( szZ );
			}
			
			memcpy ( pBrush [ iCount ].Faces [ iTemp ].Indices, wIndices, sizeof ( wIndices ) );
			CalculateNormal ( &pBrush [ iCount ].Faces [ iTemp ] );

			iInd += 3;
		}

		SetBlockPosition ( &pBrush [ iCount ], 0.0f, 0.0f, 0.0f, 1.0f );
	
		pMeshVertexBuffer->Unlock ( );
		pMeshIndexBuffer->Unlock  ( );

		iCount++;

		pMesh = pMesh->m_Next;
	}

	iCount = 0;
	pMesh  = ptr->m_Object.m_Meshes;

	for ( int iTemp = ptr->m_Object.m_NumFrames; iTemp > 0; iTemp-- )
	{
		sFrame* pFrame = ptr->m_Object.m_Frames->FindFrame ( iTemp );

		if ( pFrame )
		{
			pBrush [ iCount ].Matrix._41 = pFrame->m_matOriginal._41;
			pBrush [ iCount ].Matrix._42 = pFrame->m_matOriginal._42;
			pBrush [ iCount ].Matrix._43 = pFrame->m_matOriginal._43;

			iCount++;
		}
	}
	
	return pBrush;
}
Esempio n. 16
0
	void testConcurrentConstruction()
	{
		size_t numIterations = 10000000;
		tbb::task_group_context taskGroupContext( tbb::task_group_context::isolated );
		parallel_for( blocked_range<size_t>( 0, numIterations ), Constructor(), taskGroupContext );
	}
Esempio n. 17
0
void ConstructorFTP ( void )
{
	Constructor ( );
}
Esempio n. 18
0
Panel_Remaps::Panel_Remaps( wxNotebook *onglets )
:Panel_withAnims( onglets )
{
	Constructor();
}
medGizmoInteractionDebugger::medGizmoInteractionDebugger(mafNode* imputVme, mafObserver *listener, const char* name, bool testMode) 
{
  Constructor(imputVme, listener, name, testMode);
}