Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SX1272lib mbed-src
Settings/Variable.h
- Committer:
 - WGorniak
 - Date:
 - 2015-10-01
 - Revision:
 - 6:453b018a9ba0
 - Parent:
 - 2:8d8295a51f68
 
File content as of revision 6:453b018a9ba0:
#ifndef LIBRARIES_TESTS_RADIO_SETTINGS_VARIABLE_H_
#define LIBRARIES_TESTS_RADIO_SETTINGS_VARIABLE_H_
#include "stdint.h"
#include <string>
class Variable
{
public:
    struct ValueDescription
    {
        const int32_t value;
        const char* description;
        bool isEndRange() const
        {
            return (description == 0) && !isEnd();
        }
        bool isEnd() const
        {
            return (description == 0) && (value == 0);
        }
        static ValueDescription end()
        {
            ValueDescription vd = {0,0};
            return vd;
        }
    };
    static ValueDescription none[];
    Variable();
    bool endGuard() const;
    static int32_t nonSetValue();
    Variable(const char* name, const char* description, int32_t value, const ValueDescription* const pValueDescriptions);
    std::string name() const;
    std::string help() const;
    std::string describe(int32_t value) const;
    bool set(int32_t value);
    int32_t get() const;
    std::string describe() const;
private:
    const char* name_;
    const char* description_;
    const ValueDescription* const pValueDescriptions_;
    int32_t value_;
};
#endif /* LIBRARIES_TESTS_RADIO_SETTINGS_VARIABLE_H_ */