5 #ifndef CNOID_BASE_EXTENSION_MANAGER_H
6 #define CNOID_BASE_EXTENSION_MANAGER_H
8 #include <cnoid/Signal>
10 #include "exportdecl.h"
28 ExtensionManager(
const std::string& moduleName,
const std::string& version,
bool isPlugin);
31 const std::string& name()
const;
32 const std::string& textDomain()
const;
41 struct CNOID_EXPORT PtrHolderBase {
42 virtual ~PtrHolderBase();
46 template <
class Po
interType>
struct PtrHolder :
public PtrHolderBase {
47 PtrHolder(PointerType pointer) : pointer(pointer) { }
48 virtual ~PtrHolder() { }
53 template <
class Object>
struct PtrHolder<Object*> :
public PtrHolderBase {
54 PtrHolder(Object* pointer) : pointer(pointer) { }
55 virtual ~PtrHolder() {
delete pointer; }
59 void manageSub(PtrHolderBase* holder);
63 void addToolBar(
ToolBar* toolBar);
74 void mountToolBar(
ToolBar* toolBar);
76 template <
class Po
interType> PointerType
manage(PointerType pointer) {
77 manageSub(
new PtrHolder<PointerType>(pointer));
96 static void notifySystemUpdate();
100 void setProjectArchiver(
101 const std::string& name,
102 std::function<
bool(
Archive&)> storeFunction,
103 std::function<
void(
const Archive&)> restoreFunction);
105 void setProjectArchiver(
106 std::function<
bool(
Archive&)> storeFunction,
107 std::function<
void(
const Archive&)> restoreFunction);