• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TypeRef类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: AreIntrinsicClustersCompatible

 //------------------------------------------------------------
 bool DualTypeEqual::AreIntrinsicClustersCompatible(TypeRef typeRefX, TypeRef typeRefY) const
 {
     SubString typeXName, typeYName;
     Boolean isTypeXIntrinsicClusterType = typeRefX->IsIntrinsicClusterDataType(&typeXName);
     Boolean isTypeYIntrinsicClusterType = typeRefY->IsIntrinsicClusterDataType(&typeYName);
     return typeXName.Compare(&typeYName);
 }
开发者ID:ni,项目名称:VireoSDK,代码行数:8,代码来源:DualTypeEqual.cpp


示例2: SetVariantToDataTypeError

void VariantType::SetVariantToDataTypeError(TypeRef inputType, TypeRef targetType, TypeRef outputType, void* outputData, ErrorCluster* errPtr)
{
    if (inputType && inputType->IsCluster() && targetType->IsArray()) {
        errPtr->SetErrorAndAppendCallChain(true, kUnsupportedOnTarget, "Variant To Data");
    } else {
        errPtr->SetErrorAndAppendCallChain(true, kVariantIncompatibleType, "Variant To Data");
    }
    if (outputType && outputData) {
            outputType->InitData(outputData);
    }
}
开发者ID:cglzaguilar,项目名称:VireoSDK,代码行数:11,代码来源:Variants.cpp


示例3: VIREO_FUNCTION_SIGNATURE3

//------------------------------------------------------------
VIREO_FUNCTION_SIGNATURE3(ArrayFill, TypedArrayCoreRef, Int32, void)
{
    TypedArrayCore* array = _Param(0);
    TypeRef     eltType = array->ElementType();
    Int32       length = _Param(1);
    
    if (array->Resize1D(length)) {
        eltType->MultiCopyData(_ParamPointer(2), array->RawBegin(), length);
    }
    return _NextInstruction();
}
开发者ID:JackDunaway,项目名称:VireoSDK,代码行数:12,代码来源:Array.cpp


示例4: EggShell_FindSubValue

//------------------------------------------------------------
//! Get a reference to the type pointer and data for a sub element
VIREO_EXPORT EggShellResult EggShell_FindSubValue(TypeManagerRef tm,
        const TypeRef typeRef, void * pData, const char* eltName, TypeRef* typeRefLocation, void** dataRefLocation)
{
    if (typeRef == nullptr || !typeRef->IsValid())
        return kEggShellResult_InvalidTypeRef;

    TypeManagerScope scope(tm);
    SubString path(eltName);
    *typeRefLocation = typeRef->GetSubElementAddressFromPath(&path, pData, dataRefLocation, true);
    if (*typeRefLocation == nullptr)
        return kEggShellResult_ObjectNotFoundAtPath;

    return kEggShellResult_Success;
}
开发者ID:ni,项目名称:VireoSDK,代码行数:16,代码来源:CEntryPoints.cpp


示例5: THREAD_TADM

VariantTypeRef VariantType::CreateNewVariantFromStaticTypeAndData(const StaticTypeAndData& input)
{
    TypeRef inputType = input._paramType;
    TypeManagerRef tm = THREAD_TADM();

    auto inputData = input._pData;
    if (inputType->IsVariant()) {
        VariantTypeRef variant = *reinterpret_cast<VariantTypeRef *>(input._pData);
        inputType = variant->_underlyingTypeRef;
        inputData = variant->Begin(kPARead);
    }
    VariantTypeRef newVariant = VariantType::New(tm, inputType);
    newVariant->CopyData(inputData, newVariant->Begin(kPAWrite));
    return newVariant;
}
开发者ID:cglzaguilar,项目名称:VireoSDK,代码行数:15,代码来源:Variants.cpp


示例6: Apply

 //------------------------------------------------------------
 bool DualTypeEqual::Apply(TypeRef typeRefX, void* pDataX, TypeRef typeRefY, void* pDataY) const
 {
     EncodingEnum encodingX = typeRefX->BitEncoding();
     bool success = false;
     switch (encodingX) {
         case kEncoding_Boolean:
             success = ApplyBooleans(typeRefX, pDataX, typeRefY, pDataY);
             break;
         case kEncoding_UInt:
             success = ApplyUInts(typeRefX, pDataX, typeRefY, pDataY);
             break;
         case kEncoding_S2CInt:
             success = ApplyS2CInts(typeRefX, pDataX, typeRefY, pDataY);
             break;
         case kEncoding_IEEE754Binary:
             success = ApplyIEEE754Binaries(typeRefX, pDataX, typeRefY, pDataY);
             break;
         case kEncoding_Enum:
             success = ApplyUInts(typeRefX, pDataX, typeRefY, pDataY);
             break;
         default:
             break;
     }
     return success;
 }
开发者ID:ni,项目名称:VireoSDK,代码行数:26,代码来源:DualTypeEqual.cpp


示例7: EggShell_ReadValueString

//------------------------------------------------------------
//! Read a symbol's value as a string. Value will be formatted according to designated format.
VIREO_EXPORT EggShellResult EggShell_ReadValueString(TypeManagerRef tm, const TypeRef typeRef, void* pData, const char* format, UInt8** valueString)
{
    TypeManagerScope scope(tm);

    if (typeRef == nullptr || !typeRef->IsValid())
        return kEggShellResult_InvalidTypeRef;

    static StringRef returnBuffer = nullptr;
    if (returnBuffer == nullptr) {
        // Allocate a string the first time it is used.
        // After that it will be resized as needed.
        STACK_VAR(String, tempReturn);
        returnBuffer = tempReturn.DetachValue();
    } else {
        returnBuffer->Resize1D(0);
    }

    if (returnBuffer) {
        SubString formatss(format);
        TDViaFormatter formatter(returnBuffer, true, 0, &formatss, kJSONEncodingEggShell);
        formatter.FormatData(typeRef, pData);
        // Add an explicit null terminator so it looks like a C string.
        returnBuffer->Append((Utf8Char)'\0');
        *valueString = returnBuffer->Begin();
        return kEggShellResult_Success;
    }

    return kEggShellResult_UnableToCreateReturnBuffer;
}
开发者ID:ni,项目名称:VireoSDK,代码行数:31,代码来源:CEntryPoints.cpp


示例8: create

FunctionRef FunctionRef::create(
        TypeRef returnType,
        Visibility visibility,
        const QByteArray &name,
        const QVector<TypeRef> &argTypes,
        const QVector<QByteArray> &argNames,
        bool firstArgIsReturnValuePointer,
        ModuleRef & parent,
        llvm::LLVMContext* ctx
        )
{
    llvm::Type *lt = returnType.rawPtr();
    std::vector<llvm::Type*> largTypes(argTypes.size());
    for (int i=0; i<argTypes.size(); ++i) {
        llvm::Type *at = (llvm::Type*) argTypes[i].rawPtr();
        largTypes[i] = at;
    }

    llvm::FunctionType * lft = largTypes.empty()
            ? llvm::FunctionType::get(lt, false)
            : llvm::FunctionType::get(lt, largTypes, false)
              ;

    llvm::GlobalValue::LinkageTypes link =
            VS_Extern==visibility
            ? llvm::GlobalValue::ExternalLinkage
            : llvm::GlobalValue::PrivateLinkage
              ;

    std::string lname(name.constData(), name.size());
    llvm::Module *lm = (llvm::Module*) parent.rawPtr();
    llvm::Function *lf = llvm::Function::Create(
                lft, link, lname, lm
                );

    lf->addFnAttr(llvm::Attribute::NoUnwind);
    lf->addFnAttr(llvm::Attribute::UWTable);

    typedef llvm::Function::ArgumentListType::iterator AIt;
    int argNumber = 0;
    for (AIt it=lf->getArgumentList().begin();
         argNumber<argNames.size() ; ++argNumber, ++it)
    {
        const std::string argName(argNames[argNumber].constData());
        it->setName(argName);
    }

    if (firstArgIsReturnValuePointer) {
        llvm::Argument & firstArg = lf->getArgumentList().front();
        llvm::AttrBuilder abuilder;
        abuilder.addAttribute(llvm::Attribute::StructRet);
        abuilder.addAttribute(llvm::Attribute::NoAlias);
        firstArg.addAttr(llvm::AttributeSet::get(*ctx, 0, abuilder));
        firstArg.addAttr(llvm::AttributeSet::get(*ctx, 1, abuilder));
    }

    FunctionRef result;
    result.d = (lf);
    return result;
}
开发者ID:victor-yacovlev,项目名称:kumir2,代码行数:60,代码来源:llvm_function_3.8.cpp


示例9: VIREO_FUNCTION_SIGNATURE4

VIREO_FUNCTION_SIGNATURE4(AnalogWaveformBuild, AnalogWaveform, Timestamp, Double, TypedArrayCoreRef)
{
    _Param(0)._t0 = _ParamPointer(1) ? _Param(1) : Timestamp(0, 0);
    _Param(0)._dt = _ParamPointer(2) ? _Param(2) : 1.0;

    TypedArrayCoreRef* argY_source = _ParamPointer(3);
    TypedArrayCoreRef* waveY_dest = &_Param(0)._Y;
    if (argY_source) {
        if (!(*argY_source)->ElementType()->IsA((*waveY_dest)->ElementType())) {
            THREAD_EXEC()->LogEvent(EventLog::kHardDataError, "AnalogWaveformBuild() Type of argument-3 does not match type of output waveform");
            return THREAD_EXEC()->Stop();
        }
        TypeRef type = (*argY_source)->Type();
        type->CopyData(argY_source, waveY_dest);
    }

    return _NextInstruction();
}
开发者ID:cglzaguilar,项目名称:VireoSDK,代码行数:18,代码来源:Waveform.cpp


示例10: VIREO_FUNCTION_SIGNATURE4

//------------------------------------------------------------
VIREO_FUNCTION_SIGNATURE4(ArrayReplaceElt, TypedArrayCoreRef, TypedArrayCoreRef, Int32, void)
{
    TypedArrayCoreRef arrayOut = _Param(0);
    TypedArrayCoreRef arrayIn = _Param(1);

    TypeRef     elementType = arrayOut->ElementType();
    Int32       index = _Param(2);
    Int32       length = arrayIn->Length();
    if(arrayOut != arrayIn){
        arrayOut->Type()->CopyData(_ParamPointer(1), _ParamPointer(0));
    } 
    
    if (index >= 0 && index < length) {
        void* pDest = arrayOut->BeginAt(index);
        elementType->CopyData(_ParamPointer(3), pDest);
    }

    return _NextInstruction();
}
开发者ID:JackDunaway,项目名称:VireoSDK,代码行数:20,代码来源:Array.cpp


示例11: EggShell_DeallocateData

//------------------------------------------------------------
//! Deallocates data and frees up memory in dataRef described by typeRef
VIREO_EXPORT EggShellResult EggShell_DeallocateData(TypeManagerRef tm, const TypeRef typeRef, void* dataRef)
{
    TypeManagerScope scope(tm);
    if (typeRef == nullptr || !typeRef->IsValid()) {
        return kEggShellResult_InvalidTypeRef;
    }

    if (dataRef == nullptr) {
        return kEggShellResult_InvalidDataPointer;
    }

    NIError error = typeRef->ClearData(dataRef);
    THREAD_TADM()->Free(dataRef);
    if (error != kNIError_Success) {
        return kEggShellResult_UnableToDeallocateData;
    }

    return kEggShellResult_Success;
}
开发者ID:ni,项目名称:VireoSDK,代码行数:21,代码来源:CEntryPoints.cpp


示例12: EggShell_WriteDouble

//------------------------------------------------------------
//! Write a numeric value to a symbol. Value will be coerced as needed.
VIREO_EXPORT EggShellResult EggShell_WriteDouble(TypeManagerRef tm, const TypeRef typeRef, void* pData, Double value)
{
    TypeManagerScope scope(tm);
    if (typeRef == nullptr || !typeRef->IsValid())
        return kEggShellResult_InvalidTypeRef;

    NIError error = WriteDoubleToMemory(typeRef, pData, value);
    if (error)
        return kEggShellResult_UnexpectedObjectType;
    return kEggShellResult_Success;
}
开发者ID:ni,项目名称:VireoSDK,代码行数:13,代码来源:CEntryPoints.cpp


示例13: EggShell_AllocateData

//------------------------------------------------------------
//! Allocates enough memory to fit a new object of TypeRef
VIREO_EXPORT EggShellResult EggShell_AllocateData(TypeManagerRef tm, const TypeRef typeRef, void** dataRefLocation)
{
    TypeManagerScope scope(tm);
    if (typeRef == nullptr || !typeRef->IsValid()) {
        return kEggShellResult_InvalidTypeRef;
    }

    if (dataRefLocation == nullptr) {
        return kEggShellResult_InvalidDataPointer;
    }

    *dataRefLocation = nullptr;
    Int32 topSize = typeRef->TopAQSize();
    void* pData = THREAD_TADM()->Malloc(topSize);
    NIError error = typeRef->InitData(pData);
    if (error != kNIError_Success) {
        return kEggShellResult_UnableToAllocateData;
    }
    *dataRefLocation = pData;
    return kEggShellResult_Success;
}
开发者ID:ni,项目名称:VireoSDK,代码行数:23,代码来源:CEntryPoints.cpp


示例14: EggShell_ResizeArray

//------------------------------------------------------------
//! Resizes a variable size Array symbol to have new dimension lengths specified by newLengths, it also initializes cells for non-flat data.
VIREO_EXPORT EggShellResult EggShell_ResizeArray(TypeManagerRef tm, const TypeRef typeRef, const void* pData,
                                                 Int32 rank, Int32 dimensionLengths[])
{
    TypeManagerScope scope(tm);
    if (typeRef == nullptr || !typeRef->IsValid())
        return kEggShellResult_InvalidTypeRef;

    if (!typeRef->IsArray())
        return kEggShellResult_UnexpectedObjectType;

    if (typeRef->Rank() != rank)
        return kEggShellResult_MismatchedArrayRank;

    TypedArrayCoreRef arrayObject = *(static_cast<const TypedArrayCoreRef*>(pData));
    VIREO_ASSERT(TypedArrayCore::ValidateHandle(arrayObject));

    if (!arrayObject->ResizeDimensions(rank, dimensionLengths, true, false)) {
        return kEggShellResult_UnableToCreateReturnBuffer;
    }
    return kEggShellResult_Success;
}
开发者ID:ni,项目名称:VireoSDK,代码行数:23,代码来源:CEntryPoints.cpp


示例15: reachable

bool TypeHierarchy::reachable(const TypeRef & t1,const TypeRef & t2)
{
	if(t1 == t2) return true;

	Graph::iterator i = graph.find(&t1);
	if(i == graph.end()) 
	{
		return false;
	};
	
	Graph::const_iterator j = graph.find(&t2);
	if(j == graph.end() && t2.expected()) 
	{
		return false;
	};
	t2.addContents(this);
	j = graph.find(&t2);
	
	if(i->second.find(j->first) != i->second.end()) return true;

	Nodes ns;
	return closure(graph,i,ns,i,j->first);
};
开发者ID:mdrichar,项目名称:POGDDL,代码行数:23,代码来源:typecheck.cpp


示例16: EggShell_ReadDouble

//------------------------------------------------------------
//! Read a numeric value from a symbol. Value will be coerced as needed.
VIREO_EXPORT EggShellResult EggShell_ReadDouble(TypeManagerRef tm, const TypeRef typeRef, const void* pData, Double* result)
{
    TypeManagerScope scope(tm);
    if (typeRef == nullptr || !typeRef->IsValid())
        return kEggShellResult_InvalidTypeRef;

    if (result == nullptr)
        return kEggShellResult_InvalidResultPointer;

    NIError error = kNIError_Success;
    *result = ReadDoubleFromMemory(typeRef, pData, &error);
    if (error)
        return kEggShellResult_UnexpectedObjectType;
    return kEggShellResult_Success;
}
开发者ID:ni,项目名称:VireoSDK,代码行数:17,代码来源:CEntryPoints.cpp


示例17: add

void TypeHierarchy::add(const PTypeRef & t1,const TypeRef & t2)
{
	Graph::const_iterator i = graph.find(&t1);
	Graph::const_iterator j = graph.find(&t2);
	if(j == graph.end())
	{
		TypeRef * c = t2.clone();
		graph[c] = set<const TypeRef*>();	
		j = graph.find(&t2);
	};
	if(i == graph.end())
	{
		TypeRef * c = t1.clone();
		graph[c] = set<const TypeRef*>(); 
	};
	graph[&t1].insert(j->first);
};
开发者ID:mdrichar,项目名称:POGDDL,代码行数:17,代码来源:typecheck.cpp


示例18: EggShell_WriteValueString

//------------------------------------------------------------
// Write a string value to a symbol. Value will be parsed according to format designated.
VIREO_EXPORT EggShellResult EggShell_WriteValueString(TypeManagerRef tm, const TypeRef typeRef, void* pData, const char* format, const char* value)
{
    TypeManagerScope scope(tm);

    SubString valueString(value);

    if (typeRef == nullptr || !typeRef->IsValid())
        return kEggShellResult_InvalidTypeRef;

    EventLog log(EventLog::DevNull);
    SubString formatss(format);
    TDViaParser parser(tm, &valueString, &log, 1, &formatss, true, true, true);
    Int32 error = parser.ParseData(typeRef, pData);
    if (error) {
        return kEggShellResult_UnableToParseData;
    }

    return kEggShellResult_Success;
}
开发者ID:ni,项目名称:VireoSDK,代码行数:21,代码来源:CEntryPoints.cpp


示例19: TypeRef_ElementName

//------------------------------------------------------------
VIREO_EXPORT StringRef TypeRef_ElementName(TypeManagerRef tm, TypeRef typeRef)
{
    TypeManagerScope scope(tm);
    SubString name = typeRef->ElementName();

    static StringRef returnBuffer = nullptr;
    if (returnBuffer == nullptr) {
        // Allocate a string the first time it is used.
        // After that it will be resized as needed.
        STACK_VAR(String, tempReturn);
        returnBuffer = tempReturn.DetachValue();
    } else {
        returnBuffer->Resize1D(name.Length());
    }

    if (returnBuffer) {
        returnBuffer->CopyFromSubString(&name);
        return returnBuffer;
    }

    return nullptr;
}
开发者ID:ni,项目名称:VireoSDK,代码行数:23,代码来源:CEntryPoints.cpp


示例20: TypeRef_Next

//------------------------------------------------------------
VIREO_EXPORT TypeRef TypeRef_Next(TypeRef typeRef)
{
    return typeRef->Next();
}
开发者ID:DevinCarr,项目名称:VireoSDK,代码行数:5,代码来源:CEntryPoints.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TypeResult类代码示例发布时间:2022-05-31
下一篇:
C++ TypePtr类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap