Package pyplusplus :: Package decl_wrappers :: Module typedef_wrapper |

# Source Code for Module pyplusplus.decl_wrappers.typedef_wrapper

     1  # Copyright 2004-2008 Roman Yakovenko.
     2  # Distributed under the Boost Software License, Version 1.0. (See
     3  # accompanying file LICENSE_1_0.txt or copy at
     4  # http://www.boost.org/LICENSE_1_0.txt)
     5
     6  """defines class that configure typedef exposing"""
     7
     8  from pygccxml import declarations
     9  import decl_wrapper
    10
    11 -class typedef_t(decl_wrapper.decl_wrapper_t, declarations.typedef_t):
    12      """defines a set of properties, that will instruct Py++ how to expose the typedef
    13
    14      Today, Py++ does not exposes typedefs, but this could be changed in future.
    15      In C++, it is a common practises to give an aliases to the class. May be in
    16      future, Py++ will generate code, that will register all those aliases.
    17      """
    18
    19 -    def __init__(self, *arguments, **keywords):
    20          declarations.typedef_t.__init__(self, *arguments, **keywords )
    21          decl_wrapper.decl_wrapper_t.__init__( self )
    22          self.__is_directive = None
    23
    24      @property
    25 -    def is_directive( self ):
    26          if None is self.__is_directive:
    27              dpath = declarations.declaration_path( self )
    28              if len( dpath ) != 4:
    29                  self.__is_directive = False
    30              else:
    31                  self.__is_directive = dpath[:3] == ['::', 'pyplusplus', 'aliases']
    32          return self.__is_directive
    33