Provides access to plugins of given type / name.
| 827 | |
| 828 | // Provides access to plugins of given type / name. |
| 829 | class PluginSet final : public RefCntIface<IPluginSetImpl<PluginSet, CheckStatusWrapper> > |
| 830 | { |
| 831 | public: |
| 832 | // IPluginSet implementation |
| 833 | const char* getName() const |
| 834 | { |
| 835 | return currentPlugin.hasData() ? currentName.c_str() : NULL; |
| 836 | } |
| 837 | |
| 838 | const char* getModuleName() const |
| 839 | { |
| 840 | return currentPlugin.hasData() ? currentPlugin->getPluggedModule()->getName() : NULL; |
| 841 | } |
| 842 | |
| 843 | void set(CheckStatusWrapper* status, const char* newName) |
| 844 | { |
| 845 | try |
| 846 | { |
| 847 | namesList = newName; |
| 848 | namesList.alltrim(" \t"); |
| 849 | next(status); |
| 850 | } |
| 851 | catch (const Firebird::Exception& ex) |
| 852 | { |
| 853 | ex.stuffException(status); |
| 854 | } |
| 855 | } |
| 856 | |
| 857 | IPluginBase* getPlugin(CheckStatusWrapper* status); |
| 858 | void next(CheckStatusWrapper* status); |
| 859 | |
| 860 | PluginSet(unsigned int pinterfaceType, const char* pnamesList, |
| 861 | IFirebirdConf* fbConf) |
| 862 | : interfaceType(pinterfaceType), namesList(getPool()), |
| 863 | currentName(getPool()), currentPlugin(NULL), |
| 864 | firebirdConf(fbConf) |
| 865 | { |
| 866 | namesList.assign(pnamesList); |
| 867 | namesList.alltrim(" \t"); |
| 868 | FbLocalStatus statusWrapper; |
| 869 | next(&statusWrapper); |
| 870 | check(&statusWrapper); |
| 871 | } |
| 872 | |
| 873 | private: |
| 874 | unsigned int interfaceType; |
| 875 | PathName namesList; |
| 876 | |
| 877 | PathName currentName; |
| 878 | RefPtr<ConfiguredPlugin> currentPlugin; // Missing data in this field indicates EOF |
| 879 | |
| 880 | RefPtr<IFirebirdConf> firebirdConf; |
| 881 | MasterInterfacePtr masterInterface; |
| 882 | |
| 883 | RefPtr<PluginModule> loadModule(const PluginLoadInfo& info); |
| 884 | |
| 885 | void loadError(const Arg::StatusVector& error) |
| 886 | { |