StrategyLib.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef __MAS_STRATEGYLIB_H
  2. #define __MAS_STRATEGYLIB_H
  3. #include "Strategy.h"
  4. #define INITIALIZE_STRATEGY_SYMBOL "Initialize"
  5. #define DISPOSE_STRATEGY_SYMBOL "Dispose"
  6. #define BUILD_STRATEGY_SYMBOL "BuildStrategy"
  7. #define DESTROY_STRATEGY_SYMBOL "DestroyStrategy"
  8. #define INFO_STRATEGY_SYMBOL "GetInformation"
  9. typedef TZ_INT (* STRA_Initialize) ();
  10. typedef TZ_INT (* STRA_Dispose) ();
  11. typedef masd::Strategy * (* STRA_BuildStrategy) ();
  12. typedef TZ_INT (* STRA_DestroyStrategy) (masd::Strategy *);
  13. typedef TZ_INT (* STRA_GetInformation) (TZ_CHAR *);
  14. NAMESPACE_MAS_BEGIN
  15. class StrategyLib {
  16. public:
  17. StrategyLib(const std::string & path);
  18. ~StrategyLib();
  19. TZ_INT Initialize(StrategyInfo & jinfo);
  20. TZ_INT DestroyStrategy(Strategy * pstra);
  21. Strategy * BuildStrategy();
  22. TZ_INT GetInformation(std::string & info);
  23. void GetStraLibKey(std::string & straKey);
  24. private:
  25. std::string m_path;
  26. std::string m_straKey;
  27. TZ_DLLHD m_sohd;
  28. STRA_Initialize m_initialize;
  29. STRA_Dispose m_dispose;
  30. STRA_BuildStrategy m_buildStrategy;
  31. STRA_DestroyStrategy m_destroyStrategy;
  32. STRA_GetInformation m_getInformation;
  33. };
  34. NAMESPACE_MAS_END
  35. #endif