10 #ifndef NDSFACTORYIMPL_H
11 #define NDSFACTORYIMPL_H
24 class FactoryBaseImpl;
32 static NdsFactoryImpl& getInstance();
38 std::shared_ptr<FactoryBaseImpl> getControlSystem(
const std::string& controlSystem);
40 void loadDriver(
const std::string& driverModuleName);
55 void registerControlSystem(std::shared_ptr<FactoryBaseImpl> pControlSystem);
65 std::pair<void*, deallocateDriver_t> createDevice(FactoryBaseImpl& factory,
const std::string& driverName,
const std::string& deviceName,
const namedParameters_t& parameters);
75 void subscribe(
const std::string& pushFrom, PVBaseOutImpl* pReceiver);
77 void subscribe(
const std::string& pushFrom,
const std::string& pushTo);
79 void unsubscribe(PVBaseOutImpl* pReceiver);
81 void unsubscribe(
const std::string& pushTo);
83 void replicate(
const std::string& replicateSource, PVBaseInImpl* pDestination);
85 void replicate(
const std::string& replicateSource,
const std::string& replicateDestination);
87 void stopReplicationTo(PVBaseInImpl* pDestination);
89 void stopReplicationTo(
const std::string& replicateDestination);
92 void registerInputPV(PVBaseInImpl* pSender);
93 void deregisterInputPV(PVBaseInImpl* pSender);
94 void registerOutputPV(PVBaseOutImpl* pReceiver);
95 void deregisterOutputPV(PVBaseOutImpl* pReceiver);
98 typedef std::list<std::string> fileNames_t;
100 static fileNames_t listFiles(
const fileNames_t& folders,
const std::string& prefix,
const std::string& suffix);
102 static fileNames_t separateFoldersList(
const char* foldersList);
104 typedef std::map<std::string, std::shared_ptr<FactoryBaseImpl> > controlSystems_t;
105 controlSystems_t m_controlSystems;
106 std::mutex m_lockControlSystems;
108 typedef std::map<std::string, std::pair<allocateDriver_t, deallocateDriver_t> > driverAllocDeallocMap_t;
109 driverAllocDeallocMap_t m_driversAllocDealloc;
110 std::mutex m_lockDrivers;
112 typedef std::list<std::shared_ptr<DynamicModule> > modules_t;
115 typedef std::map<std::string, PVBaseInImpl*> registeredInputPVs_t;
116 registeredInputPVs_t m_registeredInputPVs;
118 typedef std::map<std::string, PVBaseOutImpl*> registeredOutputPVs_t;
119 registeredOutputPVs_t m_registeredOutputPVs;
121 std::recursive_mutex m_lockRegisteredPVs;
134 DynamicModule(
const std::string& libraryName);
137 void* getAddress(
const std::string& functionName);
140 void* m_moduleHandle;
151 Directory(
const std::string& directory);
154 std::string getNextFileName();
161 #endif // NDSFACTORYIMPL_H
std::function< void(void *)> deallocateDriver_t
Definition for the function executed to deallocate a driver.
Definition: definitions.h:244
std::function< void *(Factory &factory, const std::string &deviceName, const namedParameters_t ¶meters)> allocateDriver_t
Definition for the function executed to allocate a driver.
Definition: definitions.h:224
Defines all the enumeration and common types used across the NDS library.
std::map< std::string, std::string > namedParameters_t
Map containing named parameters passed to the device during the initialization.
Definition: definitions.h:222