Skip to content
Snippets Groups Projects
Select Git revision
  • 04f3b545bdec072f1f73c8cb8f261d52bbcc881b
  • master default protected
  • set_hba_element_power
  • L2SS-2199-apply-dab-to-xy
  • L2SS-2417-more-vector-memory
  • test-pytango-10.0.3
  • revert-cs032-ccd-ip
  • deploy-components-parallel
  • fix-chrony-exporter
  • L2SS-2407-swap-iers-caltable-monitoring-port
  • L2SS-2357-fix-ruff
  • sync-up-with-meta-pypcc
  • stabilise-landing-page
  • all-stations-lofar2
  • v0.39.7-backports
  • Move-sdptr-to-v1.5.0
  • fix-build-ubuntu
  • tokens-in-env-files
  • fix-build
  • L2SS-2214-deploy-cdb
  • fix-missing-init
  • v0.55.5-r2 protected
  • v0.52.8-rc1 protected
  • v0.55.5 protected
  • v0.55.4 protected
  • 0.55.2.dev0
  • 0.55.1.dev0
  • 0.55.0.dev0
  • v0.54.0 protected
  • 0.53.2.dev0
  • 0.53.1.dev0
  • v0.52.3-r2 protected
  • remove-snmp-client
  • v0.52.3 protected
  • v0.52.3dev0 protected
  • 0.53.1dev0
  • v0.52.2-rc3 protected
  • v0.52.2-rc2 protected
  • v0.52.2-rc1 protected
  • v0.52.1.1 protected
  • v0.52.1 protected
41 results

logs.rst

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    HdbppTimescaleDb.hpp 4.64 KiB
    /* Copyright (C) : 2014-2019
       European Synchrotron Radiation Facility
       BP 220, Grenoble 38043, FRANCE
    
       This file is part of libhdb++timescale.
    
       libhdb++timescale is free software: you can redistribute it and/or modify
       it under the terms of the Lesser GNU General Public License as published by
       the Free Software Foundation, either version 3 of the License, or
       (at your option) any later version.
    
       libhdb++timescale is distributed in the hope that it will be useful,
       but WITHOUT ANY WARRANTY; without even the implied warranty of
       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the Lesser
       GNU General Public License for more details.
    
       You should have received a copy of the Lesser GNU General Public License
       along with libhdb++timescale.  If not, see <http://www.gnu.org/licenses/>. */
    
    #ifndef _HDBPP_TIMESCALE_HPP
    #define _HDBPP_TIMESCALE_HPP
    
    #include <libhdb++/LibHdb++.h>
    #include <string>
    #include <tango.h>
    #include <vector>
    
    namespace hdbpp
    {
    class HdbppTimescaleDb : public AbstractDB
    {
    public:
        /**
         * @brief HdbppTimescaleDb constructor
         *
         * The configuration parameters must contain the following strings:
         *
         * @param configuration A list of configuration parameters to start the driver with.
         */
        HdbppTimescaleDb(const std::vector<std::string> &configuration);
    
        /**
         * @brief Destroy the HdbppTimescaleDb library object
         */
        virtual ~HdbppTimescaleDb();
    
        /**
         * @brief Insert an attribute archive event into the database
         *
         * Inserts an attribute archive event for the EventData into the database. If the attribute
         * does not exist in the database, then an exception will be raised. If the attr_value
         * field of the data parameter if empty, then the attribute is in an error state
         * and the error message will be archived.
         *
         * @param event_data Tango event data about the attribute.
         * @param event_data_type HDB event data for the attribute.
         * @throw Tango::DevFailed
         */
        virtual void insert_Attr(Tango::EventData *event_data, HdbEventDataType event_data_type);
    
        /**
         * @brief Inserts the attribute configuration data.
         *
         * Inserts the attribute configuration data (Tango Attribute Configuration event data)
         * into the database. The attribute must be configured to be stored in HDB++,
         * otherwise an exception will be thrown.
         *
         * @param conf_event_data Tango event data about the attribute.
         * @param event_data_type HDB event data for the attribute.
         * @throw Tango::DevFailed
         */
        virtual void insert_param_Attr(Tango::AttrConfEventData *conf_event_data, HdbEventDataType /* event_data_type */);
    
        /**
         * @brief Add and configure an attribute in the database.
         *
         * Trying to reconfigure an existing attribute will result in an exception, and if an
         * attribute already exists with the same configuration then the ttl will be updated if
         * different.
         *
         * @param fqdn_attr_name Fully qualified attribute name
         * @param type The type of the attribute.
         * @param format The format of the attribute.
         * @param write_type The read/write access of the type.
         * @param  ttl The time to live in hour, 0 for infinity
         * @throw Tango::DevFailed
         */
        virtual void configure_Attr(
            std::string fqdn_attr_name, int type, int format, int write_type, unsigned int ttl);
    
        /**
         * @brief Update the ttl value for an attribute.
         *
         * The attribute must have been configured to be stored in HDB++, otherwise an exception
         * is raised
         *
         * @param fqdn_attr_name Fully qualified attribute nam
         * @param ttl The time to live in hours, 0 for infinity
         * @throw Tango::DevFailed
         */
        virtual void updateTTL_Attr(std::string fqdn_attr_name, unsigned int ttl);
    
        /**
        * @brief Record a start, Stop, Pause or Remove history event for an attribute.
        *
        * Inserts a history event for the attribute name passed to the function. The attribute
        * must have been configured to be stored in HDB++, otherwise an exception is raised.
        * This function will also insert an additional CRASH history event before the START
        * history event if the given event parameter is DB_START and if the last history event
        * stored was also a START event.
        *
        * @param fqdn_attr_name Fully qualified attribute name
        * @param event
        * @throw Tango::DevFailed
        */
        virtual void event_Attr(std::string fqdn_attr_name, unsigned char event);
    };
    
    class HdbppTimescaleDbFactory : public DBFactory
    {
    public:
        virtual AbstractDB *create_db(std::vector<std::string> configuration);
    };
    
    } // namespace hdbpp
    #endif // _HDBPP_TIMESCALE_HPP