BaseComponent Class Reference

Components should inherit from this class rather than (. More...

#include <BaseComponent.h>

Inherits AbstractComponent.

Inherited by MultiPhysicsToMultiVisualComponent, PhysicalComponent, PlayerComponent, and VisualComponent.

Collaboration diagram for BaseComponent:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BaseComponent (const std::string &componentName, const std::string familyName)
 The BaseComponent constructor.
virtual void Attach (GameEntity *pGameEntity)
 This function simply stores a pointer to the creating entity.
virtual void Detach ()
 Empty implementation.
virtual void ToStream (std::ostream &stream) const
 Empty implementation.
virtual void FromStream (std::istream &stream)
 Empty implementation.
virtual const std::string & GetComponentName () const
virtual const std::string & GetFamilyName () const
GameEntityGetGameEntity () const

Protected Attributes

GameEntitym_pGameEntity
std::string m_componentName
std::string m_familyName

Detailed Description

Components should inherit from this class rather than (.

See also:
AbstractComponent) because it provides some basic needed functionality to components.

Constructor & Destructor Documentation

BaseComponent::BaseComponent ( const std::string &  componentName,
const std::string  familyName 
) [inline]

The BaseComponent constructor.

This should not be called directly, components should [i]only[/i] be created using the ComponentFactory.

Parameters:
componentName The textual name of this component.
familyName The textual family of this component.

Member Function Documentation

virtual void BaseComponent::Attach ( GameEntity pGameEntity  )  [inline, virtual]

This function simply stores a pointer to the creating entity.

Parameters:
pGameEntity A pointer to the entity that is stored.

Implements AbstractComponent.

virtual const std::string& BaseComponent::GetComponentName (  )  const [inline, virtual]
Returns:
The textual name of the component.

Implements AbstractComponent.

virtual const std::string& BaseComponent::GetFamilyName (  )  const [inline, virtual]
Returns:
The textual family of the component.

Implements AbstractComponent.

GameEntity* BaseComponent::GetGameEntity (  )  const [inline]
Returns:
A pointer to the entity that created this component.

The documentation for this class was generated from the following file:
 All Classes Functions Variables

Generated on Fri Nov 20 15:29:20 2009 for PhysTank by  doxygen 1.6.1