Changeset 504 for BAORadio/libindi/libindi/libs/indibase/basedriver.h
- Timestamp:
- Jun 28, 2011, 12:31:47 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BAORadio/libindi/libindi/libs/indibase/basedriver.h
r502 r504 2 2 #define INDIBASEDRIVER_H 3 3 4 #include < vector>4 #include <boost/shared_ptr.hpp> 5 5 #include <map> 6 6 #include <string> … … 26 26 public: 27 27 BaseDriver(); 28 virtual~BaseDriver();28 ~BaseDriver(); 29 29 30 30 /*! INDI error codes. */ … … 38 38 39 39 /*! INDI property type */ 40 enum INDI_TYPE40 typedef enum 41 41 { 42 42 INDI_NUMBER, /*!< INumberVectorProperty. */ … … 44 44 INDI_TEXT, /*!< ITextVectorProperty. */ 45 45 INDI_LIGHT, /*!< ILightVectorProperty. */ 46 INDI_BLOB /*!< IBLOBVectorProperty. */ 47 }; 46 INDI_BLOB, /*!< IBLOBVectorProperty. */ 47 INDI_UNKNOWN 48 } INDI_TYPE; 48 49 49 50 /** \return Return vector number property given its name */ … … 57 58 /** \return Return vector BLOB property given its name */ 58 59 IBLOBVectorProperty * getBLOB(const char *name); 60 61 void registerProperty(void *p, INDI_TYPE type); 59 62 60 63 /** \brief Remove a property … … 74 77 75 78 */ 76 void * getProperty(const char *name, INDI_TYPE & type);79 void * getProperty(const char *name, INDI_TYPE type = INDI_UNKNOWN); 77 80 78 81 /** \brief Build driver properties from a skeleton file. … … 90 93 /** \return True if the device is connected (CONNECT=ON), False otherwise */ 91 94 bool isConnected(); 92 /** \brief Connect or Disconnect a device. 93 \param status If true, the driver will attempt to connect to the device (CONNECT=ON). If false, it will attempt 94 to disconnect the device. 95 */ 96 virtual void setConnected(bool status); 95 97 96 98 97 /** \brief Set the device name … … 100 99 */ 101 100 void setDeviceName(const char *dev); 101 102 102 /** \return Returns the device name */ 103 103 const char *deviceName(); … … 107 107 */ 108 108 void addMessage(const char *msg); 109 //** \returns Returns the contents of the driver's message queue. *; 109 110 /** \return Returns the contents of the driver's message queue. */ 110 111 const char *message() { return messageQueue.c_str(); } 111 112 112 113 /** \brief Set the driver's mediator to receive notification of news devices and updated property values. */ 113 114 void setMediator(INDI::BaseMediator *med) { mediator = med; } 115 114 116 /** \returns Get the meditator assigned to this driver */ 115 117 INDI::BaseMediator * getMediator() { return mediator; } 118 116 119 117 120 protected: … … 120 123 \param root XML element to parse and build. 121 124 \param errmsg buffer to store error message in parsing fails. 122 123 125 \return 0 if parsing is successful, -1 otherwise and errmsg is set */ 124 126 int buildProp(XMLEle *root, char *errmsg); … … 133 135 char deviceID[MAXINDINAME]; 134 136 137 typedef boost::shared_ptr<INumberVectorProperty> numberPtr; 138 typedef boost::shared_ptr<ITextVectorProperty> textPtr; 139 typedef boost::shared_ptr<ISwitchVectorProperty> switchPtr; 140 typedef boost::shared_ptr<ILightVectorProperty> lightPtr; 141 typedef boost::shared_ptr<IBLOBVectorProperty> blobPtr; 142 135 143 private: 136 144 137 typedef struct 138 { 139 INDI_TYPE type; 140 void *p; 141 } pOrder; 142 143 std::vector<INumberVectorProperty *> pNumbers; 144 std::vector<ITextVectorProperty *> pTexts; 145 std::vector<ISwitchVectorProperty *> pSwitches; 146 std::vector<ILightVectorProperty *> pLights; 147 std::vector<IBLOBVectorProperty *> pBlobs; 145 std::map< boost::shared_ptr<void>, INDI_TYPE> pAll; 148 146 149 147 LilXML *lp; 150 151 std::vector<pOrder> pAll;152 148 153 149 std::string messageQueue;
Note: See TracChangeset
for help on using the changeset viewer.