Ignore:
Timestamp:
Jun 28, 2011, 12:31:47 PM (13 years ago)
Author:
frichard
Message:

-Version 0.8 de libini
-Formule de Marc
-Nouvelles fonctionnalités (goto nom-de l'objet etc...)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BAORadio/libindi/libindi/libs/indibase/basedriver.h

    r502 r504  
    22#define INDIBASEDRIVER_H
    33
    4 #include <vector>
     4#include <boost/shared_ptr.hpp>
    55#include <map>
    66#include <string>
     
    2626public:
    2727    BaseDriver();
    28     virtual ~BaseDriver();
     28    ~BaseDriver();
    2929
    3030    /*! INDI error codes. */
     
    3838
    3939    /*! INDI property type */
    40     enum INDI_TYPE
     40    typedef enum
    4141    {
    4242        INDI_NUMBER, /*!< INumberVectorProperty. */
     
    4444        INDI_TEXT,   /*!< ITextVectorProperty. */
    4545        INDI_LIGHT,  /*!< ILightVectorProperty. */
    46         INDI_BLOB    /*!< IBLOBVectorProperty. */
    47     };
     46        INDI_BLOB,    /*!< IBLOBVectorProperty. */
     47        INDI_UNKNOWN
     48    } INDI_TYPE;
    4849
    4950    /** \return Return vector number property given its name */
     
    5758    /** \return Return vector BLOB property given its name */
    5859    IBLOBVectorProperty * getBLOB(const char *name);
     60
     61    void registerProperty(void *p, INDI_TYPE type);
    5962
    6063    /** \brief Remove a property
     
    7477
    7578    */
    76     void * getProperty(const char *name, INDI_TYPE & type);
     79    void * getProperty(const char *name, INDI_TYPE type = INDI_UNKNOWN);
    7780
    7881    /** \brief Build driver properties from a skeleton file.
     
    9093    /** \return True if the device is connected (CONNECT=ON), False otherwise */
    9194    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
    9796
    9897    /** \brief Set the device name
     
    10099      */
    101100    void setDeviceName(const char *dev);
     101
    102102    /** \return Returns the device name */
    103103    const char *deviceName();
     
    107107    */
    108108    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. */
    110111    const char *message() { return messageQueue.c_str(); }
    111112
    112113    /** \brief Set the driver's mediator to receive notification of news devices and updated property values. */
    113114    void setMediator(INDI::BaseMediator *med) { mediator = med; }
     115
    114116    /** \returns Get the meditator assigned to this driver */
    115117    INDI::BaseMediator * getMediator() { return mediator; }
     118
    116119
    117120protected:
     
    120123      \param root XML element to parse and build.
    121124      \param errmsg buffer to store error message in parsing fails.
    122 
    123125      \return 0 if parsing is successful, -1 otherwise and errmsg is set */
    124126    int buildProp(XMLEle *root, char *errmsg);
     
    133135    char deviceID[MAXINDINAME];
    134136
     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
    135143private:
    136144
    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;
    148146
    149147    LilXML *lp;
    150 
    151     std::vector<pOrder> pAll;
    152148
    153149    std::string messageQueue;
Note: See TracChangeset for help on using the changeset viewer.