CSAD
 All Classes Namespaces Functions Variables Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
csad::Component Class Reference

Component - a component is a unique part of the object may not have a name, and to exist independently. More...

Inheritance diagram for csad::Component:
csad::BaseObject csad::Resender csad::SceneComponent csad::TextStyle csad::Camera csad::Light csad::MeshFilter csad::SceneResender csad::SGBaseElement csad::SGMouse csad::SGMouseMesh csad::SGTabControll csad::SGTable csad::Text3D

Public Member Functions

template<typename T >
_FORCEINLINE T * addComponent ()
 Add component of the specified type in the container if this component already exists, returns available.
 
template<typename T >
_FORCEINLINE T * getComponent ()
 Returns the component of the given type, if it is not in a container returns 0.
 
_FORCEINLINE ContainerComponentsgetContainer ()
 Returns the container in which the component.
 
template<typename T >
_FORCEINLINE T * getContainer ()
 Returns the container in which the component, if the container does not match the given type 0 is returned.
 
virtual CSAD_API void quit ()
 The event is called before the program exits.
 
CSAD_API void * set (unsigned _int32, void *)
 used for any interface commands.
 
virtual CSAD_API void start ()
 This event is fired after the program start.
 
virtual CSAD_API void update ()
 This event is fired before rendering environment container component.
 
- Public Member Functions inherited from csad::BaseObject
_FORCEINLINE bool isContainer ()
 returns true if the object is a container.
 
_FORCEINLINE ParametersListread (ParametersList *data)
 read attributes object.
 
_FORCEINLINE void * type ()
 the output pointer to the typeid() of the class.
 
_FORCEINLINE void write (ParametersList *data)
 record attributes of the object.
 

Static Public Member Functions

static CSAD_API int regClass (const char *name, const void *info, tfSTDCALL_p_FUNC_p fun)
 

Additional Inherited Members

- Public Types inherited from csad::BaseObject
enum  BASE {
  ANY = 0x00000000, EVENT = 0x00000001, TYPE = 0x00000002, CONTAINER = 0x00000003,
  MANAGER_COUNT = 0x00000004, MANAGER = 0x00000005, WRITE = 0x00000006, READ = 0x00000007,
  SELECT = 0x00000008, RUN = 0x00000009, LIST = 0x0000000A, LIST_COUNT = 0x0000000B,
  NAME = 0x0000000C, CHILD_NAME = 0x0000000D
}
 the basic format of the interface More...
 

Detailed Description

Component - a component is a unique part of the object may not have a name, and to exist independently.

The component has a pointer to the container to which it belongs.

To register the component class there are two ways. To register in the module:

  REG_COMPONENT(SomeClass)

To register the application:

  COMPONENT_CLASS(SomeClass)

  void InitClass()
  {
     INIT_COMPONENT(SomeClass)
  }

  void main()
  {
     ...
     csadStart();
     InitClass();
     ...
  }
See Also
csad: core

Member Function Documentation

static CSAD_API int csad::Component::regClass ( const char *  name,
const void *  info,
tfSTDCALL_p_FUNC_p  fun 
)
static

Registers the component class

Parameters
name- the class name of the component
info- the class identifier
fun- the class constructor