@@ -1586,6 +1586,91 @@ void MultiAttribute::get_event_param(vector<EventPar> &eve)
15861586 }
15871587}
15881588
1589+ void MultiAttribute::get_event_param (vector<EventSubscriptionState> &eve)
1590+ {
1591+ unsigned int i;
1592+
1593+ for (i = 0 ;i < attr_list.size ();i++)
1594+ {
1595+ bool once_more = false ;
1596+ vector<int > ch;
1597+ vector<int > ar;
1598+ vector<int > pe;
1599+ vector<int > us;
1600+ vector<int > ac;
1601+ bool dr = false ;
1602+ bool qu = false ;
1603+
1604+ if (attr_list[i]->change_event_subscribed () == true )
1605+ {
1606+ once_more = true ;
1607+ ch = attr_list[i]->get_client_lib (CHANGE_EVENT);
1608+ }
1609+
1610+ if (attr_list[i]->quality_event_subscribed () == true )
1611+ {
1612+ once_more = true ;
1613+ qu = true ;
1614+ }
1615+
1616+ if (attr_list[i]->periodic_event_subscribed () == true )
1617+ {
1618+ once_more = true ;
1619+ pe = attr_list[i]->get_client_lib (PERIODIC_EVENT);
1620+ }
1621+
1622+ if (attr_list[i]->archive_event_subscribed () == true )
1623+ {
1624+ once_more = true ;
1625+ ar = attr_list[i]->get_client_lib (ARCHIVE_EVENT);
1626+ }
1627+
1628+ if (attr_list[i]->user_event_subscribed () == true )
1629+ {
1630+ once_more = true ;
1631+ us = attr_list[i]->get_client_lib (USER_EVENT);
1632+ }
1633+
1634+ if (attr_list[i]->attr_conf_event_subscribed () == true )
1635+ {
1636+ once_more = true ;
1637+ ac = attr_list[i]->get_client_lib (ATTR_CONF_EVENT);
1638+ }
1639+
1640+ if (attr_list[i]->data_ready_event_subscribed () == true )
1641+ {
1642+ once_more = true ;
1643+ dr = true ;
1644+ }
1645+
1646+ if (once_more == true )
1647+ {
1648+ EventSubscriptionState ep;
1649+
1650+ if (attr_list[i]->use_notifd_event () == true )
1651+ ep.notifd = true ;
1652+ else
1653+ ep.notifd = false ;
1654+
1655+ if (attr_list[i]->use_zmq_event () == true )
1656+ ep.zmq = true ;
1657+ else
1658+ ep.zmq = false ;
1659+
1660+ ep.attribute_name = attr_list[i]->get_name ();;
1661+ ep.change = ch;
1662+ ep.quality = qu;
1663+ ep.archive = ar;
1664+ ep.periodic = pe;
1665+ ep.user = us;
1666+ ep.att_conf = ac;
1667+ ep.data_ready = dr;
1668+
1669+ eve.push_back (ep);
1670+ }
1671+ }
1672+ }
1673+
15891674// +-----------------------------------------------------------------------------------------------------------------
15901675//
15911676// method :
@@ -1676,6 +1761,82 @@ void MultiAttribute::set_event_param(vector<EventPar> &eve)
16761761 }
16771762}
16781763
1764+ void MultiAttribute::set_event_param (vector<EventSubscriptionState> &eve)
1765+ {
1766+ for (size_t i = 0 ;i < eve.size ();i++)
1767+ {
1768+ if (! eve[i].attribute_name .empty ())
1769+ {
1770+ Tango::Attribute &att = get_attr_by_name (eve[i].attribute_name .c_str ());
1771+
1772+ {
1773+ omni_mutex_lock oml (EventSupplier::get_event_mutex ());
1774+ vector<int >::iterator ite;
1775+
1776+ if (eve[i].change .empty () == false )
1777+ {
1778+ std::string event_name = EventName[CHANGE_EVENT];
1779+ for (ite = eve[i].change .begin ();ite != eve[i].change .end ();++ite)
1780+ {
1781+ att.set_change_event_sub (*ite);
1782+ att.set_client_lib (*ite, event_name);
1783+ }
1784+ }
1785+
1786+ if (eve[i].periodic .empty () == false )
1787+ {
1788+ std::string event_name = EventName[PERIODIC_EVENT];
1789+ for (ite = eve[i].periodic .begin ();ite != eve[i].periodic .end ();++ite)
1790+ {
1791+ att.set_periodic_event_sub (*ite);
1792+ att.set_client_lib (*ite, event_name);
1793+ }
1794+ }
1795+
1796+ if (eve[i].archive .empty () == false )
1797+ {
1798+ std::string event_name = EventName[ARCHIVE_EVENT];
1799+ for (ite = eve[i].archive .begin ();ite != eve[i].archive .end ();++ite)
1800+ {
1801+ att.set_archive_event_sub (*ite);
1802+ att.set_client_lib (*ite, event_name);
1803+ }
1804+ }
1805+
1806+ if (eve[i].att_conf .empty () == false )
1807+ {
1808+ std::string event_name = EventName[ATTR_CONF_EVENT];
1809+ for (ite = eve[i].att_conf .begin ();ite != eve[i].att_conf .end ();++ite)
1810+ {
1811+ att.set_att_conf_event_sub (*ite);
1812+ att.set_client_lib (*ite, event_name);
1813+ }
1814+ }
1815+
1816+ if (eve[i].user .empty () == false )
1817+ {
1818+ std::string event_name = EventName[USER_EVENT];
1819+ for (ite = eve[i].user .begin ();ite != eve[i].user .end ();++ite)
1820+ {
1821+ att.set_user_event_sub (*ite);
1822+ att.set_client_lib (*ite, event_name);
1823+ }
1824+ }
1825+
1826+ if (eve[i].quality == true )
1827+ att.set_quality_event_sub ();
1828+ if (eve[i].data_ready == true )
1829+ att.set_data_ready_event_sub ();
1830+ }
1831+
1832+ if (eve[i].notifd == true )
1833+ att.set_use_notifd_event ();
1834+ if (eve[i].zmq == true )
1835+ att.set_use_zmq_event ();
1836+ }
1837+ }
1838+ }
1839+
16791840// +------------------------------------------------------------------------------------------------------------------
16801841//
16811842// method :
0 commit comments