/usr/include/tango/rootattreg.h is in libtango-dev 9.2.5a+dfsg1-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | //===================================================================================================================
//
// file : rootattreg.h
//
// description : Include file for the RootAttRegistry and RootAttConfCallBack classes hierarchy.
// These classes are used for the forwarded attribute feature
//
// project : TANGO
//
// author(s) : A.Gotz + E.Taurel
//
// Copyright (C) : 2013,2014,2015
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// This file is part of Tango.
//
// Tango is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Tango 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
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License along with Tango.
// If not, see <http://www.gnu.org/licenses/>.
//
// $Revision: 28373 $
//
//===================================================================================================================
#ifndef _ROOTATTREG_H
#define _ROOTATTREG_H
#include <tango.h>
namespace Tango
{
struct NameFwdAttr
{
string local_name; // Local device name
string local_att_name; // Local attribute name
string local_label; // Local attribute label
FwdAttr *fwd_attr;
FwdAttr *fwd_attr_cl;
};
struct UserEvent
{
EventType event_type; // Event type
int event_id; //
};
class RootAttRegistry
{
public:
RootAttRegistry():cbp(this),cbu(this) {}
void add_root_att(string &,string &,string &,string &,FwdAttr *,DeviceImpl *);
void remove_root_att(string &,string &);
DeviceProxy *get_root_att_dp(string &);
DeviceImpl *get_local_dev(string &_s) {return cbp.get_local_dev(_s);}
string get_local_att_name(const string &_s) {return cbp.get_local_att_name(_s);}
void update_label(string &_d,string &_a,string &_l) {string s(_d+'/'+_a);cbp.update_label(s,_l);}
void update_device_impl(string &_n,DeviceImpl *_d) {cbp.update_device_impl(_n,_d);}
void clear_attrdesc(string &,string &);
bool check_root_dev_release(string &);
bool is_event_subscribed(string &,EventType);
void subscribe_user_event(string &,string &,EventType);
void unsubscribe_user_event(string &,string &,EventType);
void auto_unsub();
bool is_root_attribute(string &_s) {return cbp.is_root_att_in_map(_s);}
bool empty() {return dps.empty();}
bool is_root_dev_not_started_err() {return cbp.is_root_dev_not_started_err();}
protected:
bool check_loop(string &,string &,string &,string &);
private:
class RootAttConfCallBack: public Tango::CallBack
{
public:
RootAttConfCallBack(RootAttRegistry *_r):Tango::CallBack(),rar(_r) {ci.cpp_clnt(0);}
virtual void push_event(Tango::AttrConfEventData *);
void add_att(string &,string &,string &,FwdAttr *,DeviceImpl *);
void remove_att(string &);
void clear_attrdesc(string &);
bool is_root_att_in_map(string &);
int count_root_dev(string &);
string get_local_att_name(const string &);
DeviceImpl *get_local_dev(string &);
void update_label(string &,string &);
void update_device_impl(string &,DeviceImpl *);
void update_err_kind(string &,FwdAttError);
void device_restarting(string &);
bool is_root_dev_not_started_err();
private:
ClntIdent ci;
omni_mutex the_lock;
map<string,struct NameFwdAttr> map_attrdesc; // Key is root attribute device_name/att_name
map<string,DeviceImpl *> local_dis; // Key is local device name
RootAttRegistry *rar;
};
class RootAttUserCallBack: public Tango::CallBack
{
public:
RootAttUserCallBack(RootAttRegistry *_r):Tango::CallBack(),rar(_r) {}
virtual void push_event(Tango::EventData *);
virtual void push_event(Tango::DataReadyEventData *);
private:
RootAttRegistry *rar;
vector<string> dummy_vs;
vector<double> dummy_vd;
vector<long> dummy_vl;
};
map<string,DeviceProxy *> dps; // Key is root attribute device name
map<string,int> map_event_id; // Key is root attribute device_name/att_name
map<string,vector<UserEvent> > map_event_id_user; // Key is root attribute device name/att_name
ReadersWritersLock id_user_lock;
RootAttConfCallBack cbp;
RootAttUserCallBack cbu;
};
} // End of Tango namespace
#endif /* _ROOTATTREG_H */
|