Choreonoid  1.5
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
cnoid::ItemManager Class Reference

#include <ItemManager.h>

Classes

class  CreationPanelFilter
 
class  FileFunction
 

Public Types

enum  { PRIORITY_CONVERSION = -10, PRIORITY_OPTIONAL = 0, PRIORITY_DEFAULT = 10, PRIORITY_FORCE = 20 }
 

Public Member Functions

 ItemManager (const std::string &moduleName, MenuManager &menuManager)
 
 ~ItemManager ()
 
void detachAllManagedTypeItemsFromRoot ()
 
void bindTextDomain (const std::string &domain)
 
template<class ItemType >
ItemManagerregisterClass (const std::string &className)
 
template<class ItemType >
ItemManagerregisterClass (const std::string &className, ItemType *singletonInstance)
 This function registers a singleton item class. More...
 
template<class ItemType , class BaseType >
void registerDerivedClass (const std::string &className)
 
template<class ItemType >
ItemManageraddCreationPanel (ItemCreationPanel *panel=0)
 
template<class ItemType >
void addCreationPanelPreFilter (const typename CreationPanelFilter< ItemType >::Function &filter)
 
template<class ItemType >
void addCreationPanelPostFilter (const typename CreationPanelFilter< ItemType >::Function &filter)
 
template<class ItemType >
ItemManageraddLoader (const std::string &caption, const std::string &formatId, const std::string &extensions, const typename FileFunction< ItemType >::Function &function, int priority=PRIORITY_DEFAULT)
 
template<class ItemType >
ItemManageraddSaver (const std::string &caption, const std::string &formatId, const std::string &extensions, const typename FileFunction< ItemType >::Function &function, int priority=PRIORITY_DEFAULT)
 
template<class ItemType >
ItemManageraddLoaderAndSaver (const std::string &caption, const std::string &formatId, const std::string &extensions, const typename FileFunction< ItemType >::Function &loadingFunction, const typename FileFunction< ItemType >::Function &savingFunction, int priority=PRIORITY_DEFAULT)
 
void addMenuItemToImport (const std::string &caption, boost::function< void()> slot)
 

Static Public Member Functions

static bool getClassIdentifier (ItemPtr item, std::string &out_moduleName, std::string &out_className)
 
template<class ItemType >
static ItemType * singletonInstance ()
 
static ItemPtr create (const std::string &moduleName, const std::string &itemClassName)
 
static void reloadItems (const ItemList<> &items)
 

Friends

class Item
 
class ItemManagerImpl
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
PRIORITY_CONVERSION 
PRIORITY_OPTIONAL 
PRIORITY_DEFAULT 
PRIORITY_FORCE 

Constructor & Destructor Documentation

◆ ItemManager()

ItemManager::ItemManager ( const std::string &  moduleName,
MenuManager menuManager 
)

◆ ~ItemManager()

ItemManager::~ItemManager ( )

Member Function Documentation

◆ addCreationPanel()

template<class ItemType >
ItemManager& cnoid::ItemManager::addCreationPanel ( ItemCreationPanel panel = 0)
inline

◆ addCreationPanelPostFilter()

template<class ItemType >
void cnoid::ItemManager::addCreationPanelPostFilter ( const typename CreationPanelFilter< ItemType >::Function &  filter)
inline

◆ addCreationPanelPreFilter()

template<class ItemType >
void cnoid::ItemManager::addCreationPanelPreFilter ( const typename CreationPanelFilter< ItemType >::Function &  filter)
inline

◆ addLoader()

template<class ItemType >
ItemManager& cnoid::ItemManager::addLoader ( const std::string &  caption,
const std::string &  formatId,
const std::string &  extensions,
const typename FileFunction< ItemType >::Function &  function,
int  priority = PRIORITY_DEFAULT 
)
inline

◆ addLoaderAndSaver()

template<class ItemType >
ItemManager& cnoid::ItemManager::addLoaderAndSaver ( const std::string &  caption,
const std::string &  formatId,
const std::string &  extensions,
const typename FileFunction< ItemType >::Function &  loadingFunction,
const typename FileFunction< ItemType >::Function &  savingFunction,
int  priority = PRIORITY_DEFAULT 
)
inline

◆ addMenuItemToImport()

void ItemManager::addMenuItemToImport ( const std::string &  caption,
boost::function< void()>  slot 
)

◆ addSaver()

template<class ItemType >
ItemManager& cnoid::ItemManager::addSaver ( const std::string &  caption,
const std::string &  formatId,
const std::string &  extensions,
const typename FileFunction< ItemType >::Function &  function,
int  priority = PRIORITY_DEFAULT 
)
inline

◆ bindTextDomain()

void ItemManager::bindTextDomain ( const std::string &  domain)

◆ create()

ItemPtr ItemManager::create ( const std::string &  moduleName,
const std::string &  itemClassName 
)
static
Todo:
put a warning message to notify that the instance of this singleton class has been in the item tree

◆ detachAllManagedTypeItemsFromRoot()

void ItemManager::detachAllManagedTypeItemsFromRoot ( )

◆ getClassIdentifier()

bool ItemManager::getClassIdentifier ( ItemPtr  item,
std::string &  out_moduleName,
std::string &  out_className 
)
static

◆ registerClass() [1/2]

template<class ItemType >
ItemManager& cnoid::ItemManager::registerClass ( const std::string &  className)
inline

◆ registerClass() [2/2]

template<class ItemType >
ItemManager& cnoid::ItemManager::registerClass ( const std::string &  className,
ItemType *  singletonInstance 
)
inline

This function registers a singleton item class.

◆ registerDerivedClass()

template<class ItemType , class BaseType >
void cnoid::ItemManager::registerDerivedClass ( const std::string &  className)
inline

◆ reloadItems()

void ItemManager::reloadItems ( const ItemList<> &  items)
static

◆ singletonInstance()

template<class ItemType >
static ItemType* cnoid::ItemManager::singletonInstance ( )
inlinestatic

Friends And Related Function Documentation

◆ Item

friend class Item
friend

◆ ItemManagerImpl

friend class ItemManagerImpl
friend

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