Back to index

nux  3.0.0
Public Member Functions | Public Attributes | Static Public Attributes
nux::NObjectType Struct Reference

#include <ObjectType.h>

Collaboration diagram for nux::NObjectType:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 NObjectType ()
 NObjectType (const char *type_name, NObjectType *super_type)
bool operator== (const NObjectType &Type) const
 Return true is this has the same type as the argument type.
bool operator!= (const NObjectType &Type) const
 Return true is this has is of a different type than the argument type.
bool IsObjectType (const NObjectType &Type) const
 Return true is this has the same type as the argument type.
bool IsDerivedFromType (const NObjectType &Type) const
 Return true if this has the same type as the argument type or is derived from it.
unsigned int SubClassDepth () const

Public Attributes

const char * name
NObjectTypesuper

Static Public Attributes

static const NObjectType Null_Type

Detailed Description

Definition at line 35 of file ObjectType.h.


Constructor & Destructor Documentation

Definition at line 42 of file ObjectType.h.

    : name("Null_Type")
    , super(NULL)
  {
  }
nux::NObjectType::NObjectType ( const char *  type_name,
NObjectType super_type 
) [inline]

Definition at line 48 of file ObjectType.h.

    : name(type_name)
    , super(super_type)
  {
  }

Member Function Documentation

bool nux::NObjectType::IsDerivedFromType ( const NObjectType Type) const [inline]

Return true if this has the same type as the argument type or is derived from it.

Definition at line 73 of file ObjectType.h.

  {
    const NObjectType *current_type = this;

    while (current_type)
    {
      if (current_type == &Type)
        return true;

      current_type = current_type->super;
    }

    return false;
  }
bool nux::NObjectType::IsObjectType ( const NObjectType Type) const [inline]

Return true is this has the same type as the argument type.

Definition at line 67 of file ObjectType.h.

  {
    return this == &Type;
  }

Here is the caller graph for this function:

bool nux::NObjectType::operator!= ( const NObjectType Type) const [inline]

Return true is this has is of a different type than the argument type.

Definition at line 61 of file ObjectType.h.

  {
    return !IsObjectType (Type);
  }

Here is the call graph for this function:

bool nux::NObjectType::operator== ( const NObjectType Type) const [inline]

Return true is this has the same type as the argument type.

Definition at line 55 of file ObjectType.h.

  {
    return IsObjectType (Type);
  }

Here is the call graph for this function:

unsigned int nux::NObjectType::SubClassDepth ( ) const [inline]

Definition at line 88 of file ObjectType.h.

  {
    const NObjectType* current_type = this;
    unsigned int depth = 0;

    while (current_type)
    {
      depth++;
      current_type = current_type->super;
    }

    return depth;
  }

Member Data Documentation

Definition at line 37 of file ObjectType.h.

Definition at line 40 of file ObjectType.h.

Definition at line 38 of file ObjectType.h.


The documentation for this struct was generated from the following files: