Ejemplo n.º 1
0
QTSS_Error	QTSSCallbacks::QTSS_SendHttpPacket(QTSS_HttpSessionObject inSession, char* inValue, UInt32 inValueLen, Bool16 connectionClose)
{
	if(inSession == NULL)
		return QTSS_BadArgument;

	CHttpSession* session = (CHttpSession*)inSession;
	StrPtrLen theValue(inValue, inValueLen);
	return session->SendHTTPPacket(&theValue, connectionClose);
}
Ejemplo n.º 2
0
QTSS_Error	QTSSCallbacks::QTSS_SendHTTPPacket(QTSS_RTSPSessionObject inServiceSession, char* inValue, UInt32 inValueLen, Bool16 connectionClose, Bool16 decrement)
{
	if(inServiceSession == NULL)
		return QTSS_BadArgument;

	HTTPSessionInterface* session = (HTTPSessionInterface*)inServiceSession;
	StrPtrLen theValue(inValue, inValueLen);
	return session->SendHTTPPacket(&theValue, connectionClose, decrement);
}
Ejemplo n.º 3
0
bool	CACFDictionary::AddFloat64(const CFStringRef inKey, Float64 inValue)
{
	bool theAnswer = false;
	
	if(mMutable && (mCFDictionary != NULL))
	{
		CACFNumber theValue(inValue);
		theAnswer = AddCFType(inKey, theValue.GetCFNumber());
	}
	
	return theAnswer;
}
Ejemplo n.º 4
0
QTSS_Error QTSSCallbacks::QTSS_AppendRTSPHeader(QTSS_RTSPRequestObject inRef,
                                                        QTSS_RTSPHeader inHeader,
                                                        char* inValue,
                                                        UInt32 inValueLen)
{
    if ((inRef == NULL) || (inValue == NULL))
        return QTSS_BadArgument;
    if (inHeader >= qtssNumHeaders)
        return QTSS_BadArgument;
    
    StrPtrLen theValue(inValue, inValueLen);
    ((RTSPRequestInterface*)inRef)->AppendHeader(inHeader, &theValue);
    return QTSS_NoErr;
}
void VisualDebugger::updatePvdProperties(const PxTriangleMesh* triMesh)
{
	PVD::PvdCommLayerError error;

	bool hasMatIndex = triMesh->getTriangleMaterialIndex(0) != 0xffff;
	PxU64 theInstance(PX_PROFILE_POINTER_TO_U64(triMesh));
	
	// update arrays:
	// vertex Array:
	{ 
		const PxU8* vertexPtr = reinterpret_cast<const PxU8*>(triMesh->getVertices());
		const PxU32 vertexStride = sizeof(PxVec3);
		const PxU32 numVertices = triMesh->getNbVertices();
		error = PvdConnectionHelper::sendSingleElementArrayProperty(mPvdConnection, theInstance, TriangleMeshProp::VertexArray
																 , VectorArrayProp::Element, PVD::PvdCommLayerDatatype::Float3
																 , vertexPtr, vertexStride, numVertices);
		PX_ASSERT(error == PVD::PvdCommLayerError::None);
	}

	// index Array:
	{
		const bool has16BitIndices = triMesh->has16BitTriangleIndices();
		const PxU8* trianglePtr = reinterpret_cast<const PxU8*>(triMesh->getTriangles());
		const PxU32 triangleStride = has16BitIndices ? sizeof(PxU16)* 3 : sizeof(PxU32)* 3;
		const PxU32 numTriangles = triMesh->getNbTriangles();

		mPvdConnectionHelper.sendPrimitiveIndexArrayProperty(mPvdConnection, theInstance, TriangleMeshProp::TriangleIndexArray
															, trianglePtr, triangleStride, numTriangles, 3, has16BitIndices);
		

		PX_ASSERT(error == PVD::PvdCommLayerError::None);
	}

	// material Array:
	if(hasMatIndex)
	{
		PxU32 numMaterials = triMesh->getNbTriangles();
		PvdConnectionHelper::beginSingleElementArrayProperty(mPvdConnection, theInstance, TriangleMeshProp::TriangleMaterialArray, U16ArrayProp::Element, PVD::PvdCommLayerDatatype::U16);

		for(PxU32 m = 0; m < numMaterials; m++)
		{
			PVD::PvdCommLayerValue theValue(triMesh->getTriangleMaterialIndex(m));
			error = mPvdConnection->sendArrayObject(&theValue);
		}

		error = mPvdConnection->endArrayPropertyBlock();
		PX_ASSERT(error == PVD::PvdCommLayerError::None);
	}
}
Ejemplo n.º 6
0
bool	CACFDictionary::AddCString(const CFStringRef inKey, const char* inValue)
{
	bool theAnswer = false;
	
	if(mMutable && (mCFDictionary != NULL))
	{
		CACFString theValue(inValue);
		if(theValue.IsValid())
		{
			theAnswer = AddCFType(inKey, theValue.GetCFString());
		}
	}
	
	return theAnswer;
}
Ejemplo n.º 7
0
// -----------------------------------------------------------------------
// Abstract interface from AbstractNumericValidator
// -----------------------------------------------------------------------
void FloatDatatypeValidator::checkContent(const XMLCh*             const content
                                         ,      ValidationContext* const context
                                         ,      bool                     asBase
                                         ,      MemoryManager*     const manager)
{

    //validate against base validator if any
    FloatDatatypeValidator *pBase = (FloatDatatypeValidator*) this->getBaseValidator();
    if (pBase)
        pBase->checkContent(content, context, true, manager);

    // we check pattern first
    if ( (getFacetsDefined() & DatatypeValidator::FACET_PATTERN ) != 0 )
    {
        if (getRegex()->matches(content, manager) ==false)
        {
            ThrowXMLwithMemMgr2(InvalidDatatypeValueException
                    , XMLExcepts::VALUE_NotMatch_Pattern
                    , content
                    , getPattern()
                    , manager);
        }
    }

    // if this is a base validator, we only need to check pattern facet
    // all other facet were inherited by the derived type
    if (asBase)
        return;

    XMLFloat theValue(content, manager);
    XMLFloat *theData = &theValue;

    if (getEnumeration() != 0)
    {
        int i=0;
        int enumLength = getEnumeration()->size();
        for ( ; i < enumLength; i++)
        {
            if (compareValues(theData, (XMLFloat*) getEnumeration()->elementAt(i))==0)
                break;
        }

        if (i == enumLength)
            ThrowXMLwithMemMgr1(InvalidDatatypeValueException, XMLExcepts::VALUE_NotIn_Enumeration, content, manager);
    }

    boundsCheck(theData, manager);
}
Ejemplo n.º 8
0
void	CASettingsStorage::SetFloat64Value(CFStringRef inKey, Float64 inValue)
{
	CACFNumber theValue(inValue);
	SetCFTypeValue(inKey, theValue.GetCFNumber());
}
Ejemplo n.º 9
0
void	CASettingsStorage::SetUInt32Value(CFStringRef inKey, UInt32 inValue)
{
	CACFNumber theValue(inValue);
	SetCFTypeValue(inKey, theValue.GetCFNumber());
}
Ejemplo n.º 10
0
/*!
	@function	SetCachedObject
	
	@abstract	Cache a Quesa object in a node.
	
	@param		ioNode		Node to modify.
	
	@param		inObject	An object.
*/
void	SetCachedObject( PolyValue& ioNode, const CQ3ObjectRef& inObject )
{
	PolyValue	theValue( inObject );
	ioNode.GetDictionary().insert(
		PolyValue::Dictionary::value_type( kCacheKey, theValue ) );
}