jp.go.aist.rtm.RTC
Class FactoryGlobal<ABSTRACTCLASS,IDENTIFIER>

java.lang.Object
  extended by jp.go.aist.rtm.RTC.FactoryGlobal<ABSTRACTCLASS,IDENTIFIER>
Direct Known Subclasses:
BufferFactory, InPortConsumerFactory, InPortProviderFactory, OutPortConsumerFactory, OutPortProviderFactory, PeriodicTaskFactory, PublisherBaseFactory

public class FactoryGlobal<ABSTRACTCLASS,IDENTIFIER>
extends java.lang.Object

Factory Management class


Nested Class Summary
(package private)  class FactoryGlobal.FactoryEntry
           Class for creation/destruction interface management
static class FactoryGlobal.ReturnCode
           Return code
 
Field Summary
protected  java.util.HashMap<IDENTIFIER,FactoryGlobal.FactoryEntry> m_creators
           Map of FactoryEntry
protected  RtcDeleteFunc m_Delete
           Interface for component destruction variable
protected  RtcNewFunc m_New
           Interface for component creation variable
protected  NumberingPolicy m_policy
           Class for numbering policy (naming policy) management.
 
Constructor Summary
protected FactoryGlobal()
           FactoryGlobal constructor
 
Method Summary
 FactoryGlobal.ReturnCode addFactory(IDENTIFIER id, ObjectCreator creator, ObjectDestructor destructor)
           Resters Factory to the map.
 ABSTRACTCLASS createObject(IDENTIFIER id)
           Object generation processing
 void deleteObject(ABSTRACTCLASS obj)
           Deletes the object. This method deletes specified Object. with identifier.}
 void deleteObject(IDENTIFIER id, ABSTRACTCLASS obj)
           Deletes the object.
 java.util.Set<IDENTIFIER> getIdentifiers()
           Returns Identifiers of the map.
 boolean hasFactory(IDENTIFIER id)
           Checks whether Identifier exists in the map.
static FactoryGlobal instance()
           Creates FactoryGlobal.
 FactoryGlobal.ReturnCode removeFactory(IDENTIFIER id)
           Removes Factory from the map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_New

protected RtcNewFunc m_New
Interface for component creation variable


m_Delete

protected RtcDeleteFunc m_Delete
Interface for component destruction variable


m_policy

protected NumberingPolicy m_policy
Class for numbering policy (naming policy) management.


m_creators

protected java.util.HashMap<IDENTIFIER,FactoryGlobal.FactoryEntry> m_creators
Map of FactoryEntry

Constructor Detail

FactoryGlobal

protected FactoryGlobal()
FactoryGlobal constructor

Method Detail

instance

public static FactoryGlobal instance()
Creates FactoryGlobal.

Returns:
FactoryGlobal object

hasFactory

public boolean hasFactory(IDENTIFIER id)
Checks whether Identifier exists in the map.

Parameters:
id - Identifier
Returns:
boolean

getIdentifiers

public java.util.Set<IDENTIFIER> getIdentifiers()
Returns Identifiers of the map.

Returns:
Identifiers

addFactory

public FactoryGlobal.ReturnCode addFactory(IDENTIFIER id,
                                           ObjectCreator creator,
                                           ObjectDestructor destructor)
Resters Factory to the map.

Parameters:
id - Identifier
creator - creation function
destructor - destruction function
Returns:
The return code of ReturnCode type.

removeFactory

public FactoryGlobal.ReturnCode removeFactory(IDENTIFIER id)
Removes Factory from the map.

Parameters:
id - Identifier
Returns:
The return code of ReturnCode type.

createObject

public ABSTRACTCLASS createObject(IDENTIFIER id)
Object generation processing

This method creates the object with factory specified with identifier.

Parameters:
id - Identifier of created object
Returns:
Created object.

deleteObject

public void deleteObject(IDENTIFIER id,
                         ABSTRACTCLASS obj)
Deletes the object.

This method deletes the object with factory specified with identifier.

Parameters:
id - Identifier of deleted object
obj - Deleteed object.

deleteObject

public void deleteObject(ABSTRACTCLASS obj)
Deletes the object. This method deletes specified Object. with identifier.}

Parameters:
obj - Deleteed object.