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

Python declarations.remove_cv函数代码示例

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

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



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

示例1: is_related

 def is_related( t1, t2 ):
     """Check whether two types\\classes t1 and t2 could introduce the problem"""
     
     if declarations.is_pointer( t1 ) and declarations.is_pointer( t2 ):
         return registration_order.is_related( declarations.remove_pointer( t1 )
                                               , declarations.remove_pointer( t2 ) )
     elif declarations.is_pointer( t1 ) and not declarations.is_pointer( t2 ):
         t1 = declarations.remove_cv( declarations.remove_pointer( t1 ) )
         t2 = declarations.remove_cv( t2 )
         if declarations.is_same( t1, t2 ):
             return 1
     elif not declarations.is_pointer( t1 ) and declarations.is_pointer( t2 ):
         t1 = declarations.remove_cv( t1 )
         t2 = declarations.remove_cv( declarations.remove_pointer( t2 ) )
         if declarations.is_same( t1, t2 ):
             return -1
     else: #not is_pointer( t1 ) and not is_pointer( t2 ):     
         if declarations.is_integral( t1 ) and not declarations.is_bool( t1 ) \
            and declarations.is_bool( t2 ):
             return -1
         elif declarations.is_bool( t1 ) \
              and declarations.is_integral( t2 ) and not declarations.is_bool( t2 ):
             return 1
         else:
             pass
     return None
开发者ID:atemysemicolon,项目名称:pyplusplusclone,代码行数:26,代码来源:algorithm.py


示例2: _update_containers_db

    def _update_containers_db( self, type_ ):
        #will return True is type was treated
        type_ = declarations.remove_alias( type_ )
        type_ = declarations.remove_pointer( type_ )
        type_ = declarations.remove_reference( type_ )
        type_ = declarations.remove_cv( type_ )
        type_ = declarations.remove_declarated( type_ )

        class_traits = declarations.class_traits
        class_declaration_traits = declarations.class_declaration_traits
        if not class_traits.is_my_case( type_ ) and not class_declaration_traits.is_my_case( type_ ):
            return False

        if class_traits.is_my_case( type_ ):
            container_cls = class_traits.get_declaration( type_ )
        else:
            container_cls = class_declaration_traits.get_declaration( type_ )

        if None is container_cls.indexing_suite:
            return False

        try:
            #check extraction of element type from container
            container_cls.indexing_suite.element_type
        except RuntimeError:
            decls_logger = _logging_.loggers.declarations
            if not messages.filter_disabled_msgs([messages.W1042], container_cls.disabled_messages ):
                return #user disabled property warning
            decls_logger.warn( "%s;%s" % ( container_cls, messages.W1042 ) )
        self.__containers.add( container_cls )
        return True
开发者ID:CTrauma,项目名称:pypp11,代码行数:31,代码来源:types_database.py


示例3: filter_decls

def filter_decls(mb):
    mb.global_ns.exclude()
    fx_ns = mb.namespace( 'FX' )
    fx_ns.include()
    fx_ns.decls( declarations_to_exclude.is_excluded ).exclude()
    fx_ns.decls( lambda decl: decl.name.startswith('FXIPCMsgHolder') ).exclude()
    fx_ns.namespace( 'Pol' ).exclude()
    fx_ns.decls( files_to_exclude.is_excluded ).exclude()
    fx_ns.class_( 'QValueList<FX::Pol::knowReferrers::ReferrerEntry>').exclude()
    try:
        fx_ns.variables( 'metaClass').exclude()
    except: pass
    try:
        fx_ns.class_( 'QPtrVector<FX::Generic::BoundFunctorV>').exclude()
    except: pass
    #Niall? wrapper for this function could not be compiled
    #TnFXSQLDBStatement = fx_ns.class_( 'TnFXSQLDBStatement' )
    #TnFXSQLDBStatement.member_function( name='bind', arg_types=[None,None,None] ).exclude()

    for func in fx_ns.calldefs():
        #I want to exclude all functions that returns pointer to pointer
        #and returns pointer to fundamental type
        if declarations.is_pointer( func.return_type ):
            temp = declarations.remove_pointer( func.return_type )
            if declarations.is_fundamental( temp ) and not declarations.is_const(temp):
                func.exclude()
            temp = declarations.remove_cv( func.return_type )
            temp = declarations.remove_pointer( temp )
            if declarations.is_pointer( temp ):
                func.exclude()
开发者ID:ned14,项目名称:tnfox,代码行数:30,代码来源:create_tnfox.py


示例4: check_type_compatibility

    def check_type_compatibility( self, fget, fset ):
        #algorithms allows "const" differences between types
        t1 = fget.return_type
        t2 = fset.arguments[0].type

        if declarations.is_same( t1, t2 ):
            return True
        elif declarations.is_pointer( t1 ) and declarations.is_pointer( t2 ):
            t1 = declarations.remove_cv( declarations.remove_pointer( t1 ) )
            t2 = declarations.remove_cv( declarations.remove_pointer( t2 ) )
            return declarations.is_same( t1, t2 )
        elif declarations.is_reference( t1 ) and declarations.is_reference( t2 ):
            t1 = declarations.remove_cv( declarations.remove_reference( t1 ) )
            t2 = declarations.remove_cv( declarations.remove_reference( t2 ) )
            return declarations.is_same( t1, t2 )
        else:
            return False
开发者ID:alekob,项目名称:tce,代码行数:17,代码来源:properties.py


示例5: __is_invalid_integral

 def __is_invalid_integral(self, func, arg):
     type_ = declarations.remove_reference(declarations.remove_cv(arg.type))
     if not declarations.is_integral(type_):
         return False
     try:
         int(arg.default_value)
         return False
     except:
         return True
开发者ID:praetorian20,项目名称:pygccxml,代码行数:9,代码来源:patcher.py


示例6: _resolve_by_type

 def _resolve_by_type( self, some_type ):
     temp_type = declarations.remove_alias( some_type )
     temp_type = declarations.remove_cv( temp_type )
     if isinstance( temp_type, declarations.fundamental_t ) \
        or isinstance( temp_type, declarations.declarated_t ):
         return decl_wrappers.default_call_policies()
     if declarations.is_same( some_type, self.__const_char_pointer ):
         return decl_wrappers.default_call_policies()
     return None
开发者ID:alekob,项目名称:tce,代码行数:9,代码来源:call_policies_resolver.py


示例7: __fix_unqualified_enum

 def __fix_unqualified_enum(self, func, arg):
     type_ = declarations.remove_reference(declarations.remove_cv(arg.type))
     enum_type = declarations.enum_declaration(type_)
     if self.__cxx_std.is_cxx11_or_greater:
         qualifier_decl_string = enum_type.decl_string
     else:
         qualifier_decl_string = enum_type.parent.decl_string
     return self.__join_names(
         qualifier_decl_string,
         arg.default_value.split('::')[-1])
开发者ID:praetorian20,项目名称:pygccxml,代码行数:10,代码来源:patcher.py


示例8: __is_unqualified_enum

 def __is_unqualified_enum(self, func, arg):
     type_ = declarations.remove_reference(declarations.remove_cv(arg.type))
     if not declarations.is_enum(type_):
         return False
     enum_type = declarations.enum_declaration(type_)
     # GCCXML does not qualify an enum value in the default argument
     # but CastXML does. Split the default value and use only the
     # enum value for fixing it.
     return enum_type.has_value_name(
         arg.default_value.split('::')[-1])
开发者ID:praetorian20,项目名称:pygccxml,代码行数:10,代码来源:patcher.py


示例9: find_out_opaque_decl

def find_out_opaque_decl( type_, ensure_opaque_decl ):
    naked_type = declarations.remove_cv( type_ )
    if not declarations.is_pointer( naked_type ):
        return None
    naked_type = declarations.remove_pointer( declarations.remove_cv( type_ ) )
    if decl_wrappers.python_traits.is_immutable( naked_type ):
        return None#immutable types could not be opaque
    decl = None
    if declarations.is_class( naked_type ):
        decl = declarations.class_traits.get_declaration( naked_type )
    elif declarations.is_class_declaration( naked_type ):#class declaration:
        decl = declarations.class_declaration_traits.get_declaration( naked_type )
    else:
        return None
    if ensure_opaque_decl:
        if decl.opaque:
            return decl
        else:
            return None
    else:
        return decl
开发者ID:CTrauma,项目名称:pypp11,代码行数:21,代码来源:opaque_types_manager.py


示例10: __has_unexposed_dependency

    def __has_unexposed_dependency( self, exported_ids, depend_on_decl, dependency ):
        sptr_traits = declarations.smart_pointer_traits

        if None is depend_on_decl:
            return

        if self.__is_std_decl( depend_on_decl ):
            return

        if sptr_traits.is_smart_pointer( depend_on_decl ):
            try:
                value_type = sptr_traits.value_type( depend_on_decl )
                if isinstance( value_type, declarations.type_t ):
                    value_type = declarations.remove_cv( value_type )
                    value_type = declarations.remove_declarated( value_type )
                if isinstance( value_type, declarations.declaration_t ):
                    return self.__has_unexposed_dependency( exported_ids, value_type, dependency )
            except RuntimeError:
                pass

        if isinstance( depend_on_decl, decl_wrappers.decl_wrapper_t ):
            if depend_on_decl.already_exposed:
                return
            if isinstance( depend_on_decl, declarations.class_types ):
                if depend_on_decl.opaque:
                    return
                if dependency.hint == "base class":
                    return #base class for some class don't have to be exported
            if isinstance( depend_on_decl, declarations.variable_t ):
                if not depend_on_decl.expose_value:
                    return

        if isinstance( dependency.declaration, declarations.variable_t ):
            #the only dependency of the variable is its type
            if not dependency.declaration.expose_value:
                return

        if dependency.hint == "return type":
            #in this case we don't check, the return type but the function
            if isinstance( dependency.declaration, declarations.calldef_t ):
                if dependency.declaration.return_type and dependency.declaration.call_policies \
                   and decl_wrappers.is_return_opaque_pointer_policy( dependency.declaration.call_policies ):
                   return

        return id( depend_on_decl ) not in exported_ids
开发者ID:Sandern,项目名称:py-source-sdk-2013,代码行数:45,代码来源:dependencies_manager.py


示例11: __init__

    def __init__(self, function, arg_ref, size):
        """Constructor.

        :param maxsize: The maximum string size we will allow...
        :type maxsize: int
        """
        transformer.transformer_t.__init__( self, function )

        self.arg = self.get_argument( arg_ref )
        self.arg_index = self.function.arguments.index( self.arg )

        if not is_ptr_or_array( self.arg.type ):
            raise ValueError( '%s\nin order to use "input_array" transformation, argument %s type must be a array or a pointer (got %s).' ) \
                  % ( function, self.arg.name, self.arg.type)

        self.max_size = size
        self.array_item_type = declarations.remove_const( declarations.array_item_type( self.arg.type ) )
        self.array_item_rawtype = declarations.remove_cv( self.arg.type )
        self.array_item_rawtype = declarations.pointer_t( self.array_item_type )
开发者ID:holocronweaver,项目名称:python-ogre,代码行数:19,代码来源:PO_FuncTransform.py


示例12: __call__

    def __call__(self, calldef, hint=None):
        if not isinstance( calldef, declarations.calldef_t ):
            return None

        if not isinstance( calldef, declarations.member_operator_t ):
            return None
        
        if calldef.symbol != '[]':
            return None
            
        return_type = declarations.remove_cv( calldef.return_type )
        if declarations.is_reference( return_type ): 
            return_type = declarations.remove_reference( return_type )
        if python_traits.is_immutable( return_type ):
            if declarations.is_const( calldef.return_type ):
                return decl_wrappers.return_value_policy( decl_wrappers.copy_const_reference )
            else:
                return decl_wrappers.return_value_policy( decl_wrappers.copy_non_const_reference )
        else:
            return decl_wrappers.return_internal_reference()
开发者ID:alekob,项目名称:tce,代码行数:20,代码来源:call_policies_resolver.py


示例13: __fix_unqualified_enum

 def __fix_unqualified_enum( self, func, arg):
     type_ = declarations.remove_reference( declarations.remove_cv( arg.type ) )
     enum_type = declarations.enum_declaration( type_ )
     return self.__join_names( enum_type.parent.decl_string, arg.default_value )
开发者ID:151706061,项目名称:ITK,代码行数:4,代码来源:patcher.py


示例14: print

cv1 = global_namespace.variable("cv1")
print(str(cv1.decl_type), type(cv1.decl_type))
# > 'int const volatile', <class 'pygccxml.declarations.cpptypes.volatile_t'>

# Remove one level:
base = declarations.remove_volatile(cv1.decl_type)
print(str(base), type(base))
# > 'int const', <class 'pygccxml.declarations.cpptypes.const_t'>

# Remove the second level:
base = declarations.remove_const(base)
print(str(base), type(base))
# > 'int', <class 'pygccxml.declarations.cpptypes.int_t'>

# We can also directly do this in one step:
base = declarations.remove_cv(cv1.decl_type)
print(str(base), type(base))
# > 'int', <class 'pygccxml.declarations.cpptypes.int_t'>

# As for consts, the const and volatile are on the right hand side
# (by convention), and always in the same order
cv2 = global_namespace.variable("cv2")
print(str(cv2.decl_type), type(cv2.decl_type))
# > 'int const volatile', <class 'pygccxml.declarations.cpptypes.volatile_t'>

# And a last example with a pointer_t:
cptr1 = global_namespace.variable("cptr1")
print(str(cptr1.decl_type), type(cptr1.decl_type))
# > 'int const * const', <class 'pygccxml.declarations.cpptypes.const_t'>)

base = declarations.remove_const(cptr1.decl_type)
开发者ID:gccxml,项目名称:pygccxml,代码行数:31,代码来源:example.py


示例15: __is_unqualified_enum

 def __is_unqualified_enum(self, func, arg):
     type_ = declarations.remove_reference( declarations.remove_cv( arg.type ) )
     if not declarations.is_enum( type_ ):
         return False
     enum_type = declarations.enum_declaration( type_ )
     return enum_type.has_value_name( arg.default_value )
开发者ID:151706061,项目名称:ITK,代码行数:6,代码来源:patcher.py


示例16: __is_invalid_integral

 def __is_invalid_integral(self, func, arg):
     type_ = declarations.remove_reference( declarations.remove_cv( arg.type ) )        
     return declarations.is_integral( type_ )
开发者ID:glehmann,项目名称:WrapITK-unstable,代码行数:3,代码来源:patcher.py


示例17: set_array_item_type_as_size_t

def set_array_item_type_as_size_t(klass, member_name):
    _D.remove_cv(_D.remove_alias(klass.var(member_name).type)).base = size_t_t()
开发者ID:BackupGGCode,项目名称:pyopencv,代码行数:2,代码来源:memvar_transformers.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python declarations.remove_pointer函数代码示例发布时间:2022-05-25
下一篇:
Python declarations.remove_const函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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