您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ type_info函数代码示例

51自学网 2021-06-03 09:02:28
  C++
这篇教程C++ type_info函数代码示例写得很实用,希望能帮到您。

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

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

示例1: superclass

  Object* Class::set_superclass(STATE, Object* obj) {    if(obj->nil_p()) {      superclass(state, nil<Class>());      return cNil;    }    Class* sup = try_as<Class>(obj);    if(!sup) {      return Primitives::failure();    }    if(try_as<SingletonClass>(sup)) {      Exception::raise_type_error(state, "cannot inherit from a singleton class");    }    superclass(state, sup);    instance_type(state, sup->instance_type());    if(sup->type_info()->type == PackedObject::type) {      type_info(state->memory()->type_info[ObjectType]);    } else {      type_info(sup->type_info());    }    SingletonClass::attach(state, this, sup->singleton_class(state));    sup->track_subclass(state, this);    return cNil;  }
开发者ID:JesseChavez,项目名称:rubinius,代码行数:30,


示例2: type_info

  Object* Class::allocate(STATE) {    Object* obj = cNil;    object_type obj_type = type_info()->type;    if(obj_type == PackedObject::type) {      obj = allocate_packed(state, this);    } else if(!type_info()->allow_user_allocate || kind_of<SingletonClass>(this)) {      std::ostringstream msg;      msg << "direct allocation disabled for ";      if(kind_of<SingletonClass>(this)) {         msg << to_string(state);      } else {         msg << module_name()->debug_str(state);      }      Exception::raise_type_error(state, msg.str().c_str());    } else if(obj_type == Object::type) {      auto_pack(state);      obj = allocate_packed(state, this);    } else {      // type_info()->type is neither PackedObject nor Object, so use the      // generic path.      obj = state->memory()->new_object<Object>(          state, this, type_info()->instance_size, obj_type);    }#ifdef RBX_ALLOC_TRACKING    if(unlikely(state->vm()->allocation_tracking())) {      new_obj->setup_allocation_site(state);    }#endif    return obj;  }
开发者ID:JesseChavez,项目名称:rubinius,代码行数:33,


示例3: InOutParameter

 InOutParameter (Path const& path,                 unsigned long line,                 std::string const& name)     : Node (path, line), Parameter (name) {   type_info (static_type_info ()); }
开发者ID:EnasAlikhashashashneh,项目名称:OASIS,代码行数:7,


示例4: ReadWriteAttribute

 ReadWriteAttribute (Path const& path, unsigned long line)     : Node (path, line),       ReadAttribute (path, line),       WriteAttribute (path, line) {   type_info (static_type_info ()); }
开发者ID:DOCGroup,项目名称:XSC,代码行数:7,


示例5: p3dc_free_type

/* * Free a type, this 'backs up' the pointer to get back to the p3dc_NODE * structure, verifies that we are in fact the correct NODE for this * type and then adds the type back into the Pool of free structures. */voidp3dc_free_type(void *payload) {	p3dc_NODE *n;	struct tinfo *ti;	__free_type_called++;	if (payload == NULL)		return;	n = (void *)(((char *)payload) - NODE_SIZE);	if (n->data.p != payload)		return;	/* Can't free "unknown" types */	if (n->data.t == P3DC_UNKNOWN) 		return; 	ti = type_info(n->data.t);	if (ti == NULL) {		__free_no_type++;		return; /* wasn't a recognized type (could be an assert)*/	}	ti->stats.frees++;	/* n->owner != NULL means it is already on the free list! */	assert(n->owner == NULL); 	p3dc_add_node(ti->pool, n, P3DC_LIST_HEAD);}
开发者ID:ChuckM,项目名称:Project3DC,代码行数:32,


示例6: IntOr

 IntOr (Path const& path, unsigned long line)     : Node (path, line),       first_pattern_ (0),       second_pattern_ (0) {   type_info (static_type_info ()); }
开发者ID:DOCGroup,项目名称:XSC,代码行数:7,


示例7: IntLiteral

 IntLiteral (Path const& path,             unsigned long line,             unsigned long long value)     : Node (path, line), value_ (value) {   type_info (static_type_info ()); }
开发者ID:DOCGroup,项目名称:XSC,代码行数:7,


示例8: IntSub

 IntSub (Path const& path, unsigned long line)     : Node (path, line),       minuend_ (0),       subtrahend_ (0) {   type_info (static_type_info ()); }
开发者ID:DOCGroup,项目名称:XSC,代码行数:7,


示例9: IntLsh

 IntLsh (Path const& path, unsigned long line)     : Node (path, line),       pattern_ (0),       factor_ (0) {   type_info (static_type_info ()); }
开发者ID:DOCGroup,项目名称:XSC,代码行数:7,


示例10: IntAdd

 IntAdd (Path const& path, unsigned long line)     : Node (path, line),       first_item_ (0),       second_item_ (0) {   type_info (static_type_info ()); }
开发者ID:DOCGroup,项目名称:XSC,代码行数:7,


示例11: IntMul

 IntMul (Path const& path, unsigned long line)     : Node (path, line),       first_factor_ (0),       second_factor_ (0) {   type_info (static_type_info ()); }
开发者ID:DOCGroup,项目名称:XSC,代码行数:7,


示例12: IntRem

 IntRem (Path const& path, unsigned long line)     : Node (path, line),       divident_ (0),       divisor_ (0) {   type_info (static_type_info ()); }
开发者ID:DOCGroup,项目名称:XSC,代码行数:7,


示例13: p3dc_new_type

/* * Allocate a new P3DC Type structure. * * This code first checks to see if the pool of free structures * of this type has any available structures, if so it returns * one, else it allocates one. */void *p3dc_new_type(p3dc_TYPE t) {	p3dc_NODE	*r;	struct tinfo *ti = type_info(t);	__new_type_called++;	if (ti == NULL)		return NULL;	assert(ti->pool->n_type == t);	ti->stats.allocs++;	if (ti->pool->head != NULL) {		r = p3dc_remove_node(ti->pool, P3DC_NODE_FIRST);	} else {		__new_forced_malloc++;		r = (p3dc_NODE *)malloc(NODE_SIZE + ti->size);		r->data.p = ((char *) r) + NODE_SIZE;		r->data.t = t;		r->owner = NULL;		r->name = NULL;		r->nxt = r->prv = NULL;		r->parent = NULL;	}	return (r->data.p);}
开发者ID:ChuckM,项目名称:Project3DC,代码行数:33,


示例14: get_derived_class_object

 static inline PyTypeObject* get_derived_class_object(boost::python::detail::true_, U const volatile* x) {     converter::registration const* r = converter::registry::query(         type_info(typeid(*get_pointer(x)))     );     return r ? r->m_class_object : 0; }
开发者ID:AbhinavJain13,项目名称:turicreate,代码行数:7,


示例15: type_info

Var Interpreter::update_Callable( Var callable, Var varargs ) {    // -> new Callable[ surdef_list, self_type, parm_type ]    TypeInfo *type = type_info( callable.type_expr() );    if ( isa_Void( type->parameters[ 2 ] ) ) {        // -> no previously defined parms        Expr n_data = concat( callable.expr(), pointer_on( varargs.expr() ) );        Var varargs_type = type_of( varargs );        // -> Callable[ surdef_list, self_type, parm_type ]        Var *parms[ 3 ];        parms[ 0 ] = &type->parameters[ 0 ];        parms[ 1 ] = &type->parameters[ 1 ];        parms[ 2 ] = &varargs_type;        Var res( type_for( class_info( class_Callable ), parms ), n_data );        res.add_ref_from( callable );        res.add_ref( callable.expr().size_in_bits(), varargs );        return res;    }    //    PRINT( type->parameters[ 2 ] );    TODO;    return error_var;}
开发者ID:hleclerc,项目名称:Stela,代码行数:25,


示例16: EventTypeFactory

 EventTypeFactory (Path const& path, unsigned long line)     : Node (path, line),       TwoWayOperation (path, line),       ValueTypeFactory (path, line) {   type_info (static_type_info ()); }
开发者ID:EnasAlikhashashashneh,项目名称:OASIS,代码行数:7,


示例17: SetContentSetsParent

ContentControl::ContentControl (){	SetContentSetsParent (true);	SetObjectType (Type::CONTENTCONTROL);	ManagedTypeInfo type_info (GetObjectType (), "System.Windows.Controls.ContentControl");	SetDefaultStyleKey (&type_info);}
开发者ID:kangaroo,项目名称:moon,代码行数:8,


示例18: register_type

void register_type(const std::type_info& Info, const string_t& Name){	if(type_to_name_map.count(type_info(Info)))	{		k3d::log() << error << k3d_file_reference << ": attempt to re-register type [" << demangle(Info) << "] with existing name [" << type_to_name_map[type_info(Info)] << "] under new name [" << Name << "]" << std::endl;		return;	}	if(type_to_name_map.count(type_info(Info)) || name_to_type_map.count(Name))	{		k3d::log() << error << k3d_file_reference << ": attempt to register new type [" << demangle(Info) << "] using existing name [" << Name << "]" << std::endl;		return;	}	type_to_name_map.insert(std::make_pair(type_info(Info), Name));	name_to_type_map.insert(std::make_pair(Name, type_info(Info)));}
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:17,


示例19: type_id

inline type_info type_id(){    return type_info(#  if !defined(_MSC_VER)                                       /      || !BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700)        typeid(T)#  else // strip the decoration which Intel mistakenly leaves in        python::detail::msvc_typeid((geofeatures_boost::type<T>*)0)#  endif         );}
开发者ID:Niko-r,项目名称:geofeatures,代码行数:11,


示例20: type_id

inline type_info type_id(BOOST_EXPLICIT_TEMPLATE_TYPE(T)){    return type_info(#  if !defined(_MSC_VER)                                       /      || (!BOOST_WORKAROUND(BOOST_MSVC, <= 1300)                /          && !BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700))        typeid(T)#  else // strip the decoration which msvc and Intel mistakenly leave in        python::detail::msvc_typeid((boost::type<T>*)0)#  endif         );}
开发者ID:Albermg7,项目名称:boost,代码行数:12,


示例21: connect

 virtual void connect(SimObjPtr s, bool) {     auto portOut = dynamic_cast<SimMemoryTemplate<T> *>(s);     if (type_info(nullValue) == portOut->getMemoryTypeInfo()) {         sourcePorts.push_back(new SourcePort(portOut, portOut->getCurrentValuePtr()));         portOut->incrementFanOut();     } else {         std::cout << "*** Source/sink port value type mismatch, "         << "source: " << s->getFullName()         << ", sink: " << getFullName()         << " ***" << std::endl;     } }
开发者ID:eightycc,项目名称:i650,代码行数:12,


示例22: AnyType

 AnyType () {   type_info (static_type_info ()); }
开发者ID:DOCGroup,项目名称:XSC,代码行数:4,


示例23: AnyUri

 AnyUri (void) {   type_info (static_type_info ()); }
开发者ID:DOCGroup,项目名称:XSC,代码行数:4,


示例24: NormalizedString

 NormalizedString () {   type_info (static_type_info ()); }
开发者ID:DOCGroup,项目名称:XSC,代码行数:4,


示例25: AnySimpleType

 AnySimpleType () {   type_info (static_type_info ()); }
开发者ID:DOCGroup,项目名称:XSC,代码行数:4,


示例26: Href

 Href () {   type_info (static_type_info ()); }
开发者ID:DOCGroup,项目名称:XSC,代码行数:4,


示例27: QName

 QName () {   type_info (static_type_info ()); }
开发者ID:DOCGroup,项目名称:XSC,代码行数:4,


示例28: NMTOKEN

 NMTOKEN () {   type_info (static_type_info ()); }
开发者ID:DOCGroup,项目名称:XSC,代码行数:4,


示例29: Token

 Token () {   type_info (static_type_info ()); }
开发者ID:DOCGroup,项目名称:XSC,代码行数:4,



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


C++ type_keystroke_by_string函数代码示例
C++ type_fake函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。