CreatedChannelLinker.h

Go to the documentation of this file.
00001 /**********************************************************************
00002  *<
00003     FILE: CreatedChannelLinker.h
00004 
00005     DESCRIPTION: Class definitions for CreatedChannelLinker
00006                 CreatedChannelLinker keeps track of all channels created for
00007                 a specific particle container. If an action creates a channel
00008                 only under certain condition (for example, if the channel 
00009                 doesn't exists) then it's the action responsibility to 
00010                 initialized channel value for all new particles. Therefore
00011                 the action should keep track of all channels created by the
00012                 action. The class makes this task easier.
00013 
00014     CREATED BY: Oleg Bayborodin
00015 
00016     HISTORY:    created 03-11-2002
00017 
00018  *> Copyright (c) 2001, All Rights Reserved.
00019  **********************************************************************/
00020 
00021 #pragma once
00022 #include "PFExport.h"
00023 #include "..\maxheap.h"
00024 #include "..\maxtypes.h"
00025 #include "..\tab.h"
00026 // forward declarations
00027 class IObject;
00028 
00029 namespace PF {
00030 
00031 class CreatedChannelLinker : public MaxHeapOperators {
00032 public:
00033 
00034     PFExport CreatedChannelLinker();
00035     PFExport ~CreatedChannelLinker();
00036 
00037     // to indicated that the channel was created in this container
00038     PFExport bool RegisterCreatedChannel(IObject* pCont, Interface_ID channelID);
00039     // to unregister all created channels in the container
00040     PFExport void Release(IObject* pCont);
00041     // verify if the channel was created for the container
00042     PFExport bool IsCreatedChannel(IObject* pCont, Interface_ID channelID) const;
00043 
00044 private:
00045     // const access to class members
00046     const Tab<IObject*>&        particleContainers()            const { return m_particleContainers; }
00047     IObject*                    particleContainer(int index)    const { return m_particleContainers[index]; }
00048     const Tab<Interface_ID>&    IDs()                           const { return m_IDs; }
00049     Interface_ID                ID(int index)                   const { return m_IDs[index]; }
00050 
00051     // access to class members
00052     Tab<IObject*>&          _particleContainers()           { return m_particleContainers; }
00053     IObject*&               _particleContainer(int index)   { return m_particleContainers[index]; }
00054     Tab<Interface_ID>&      _IDs()                          { return m_IDs; }
00055     Interface_ID&           _ID(int index)                  { return m_IDs[index]; }
00056 
00057 protected:
00058     Tab<IObject*> m_particleContainers;
00059     Tab<Interface_ID> m_IDs;
00060 };
00061 
00062 
00063 } // end of namespace PF
00064 
00065 
00066