This is Unofficial EPICS BASE Doxygen Site
netSubscription Class Reference

#include "netIO.h"

+ Inheritance diagram for netSubscription:
+ Collaboration diagram for netSubscription:

Public Member Functions

void show (unsigned level) const
 
void show (epicsGuard< epicsMutex > &, unsigned level) const
 
arrayElementCount getCount (epicsGuard< epicsMutex > &, bool allow_zero) const
 
unsigned getType (epicsGuard< epicsMutex > &) const
 
unsigned getMask (epicsGuard< epicsMutex > &) const
 
void subscribeIfRequired (epicsGuard< epicsMutex > &guard, nciu &chan)
 
void unsubscribeIfRequired (epicsGuard< epicsMutex > &guard, nciu &chan)
 
- Public Member Functions inherited from baseNMIU
virtual void destroy (epicsGuard< epicsMutex > &, class cacRecycle &)=0
 
- Public Member Functions inherited from tsDLNode< baseNMIU >
 tsDLNode ()
 
 tsDLNode (const tsDLNode< baseNMIU > &)
 
const tsDLNode< baseNMIU > & operator= (const tsDLNode< baseNMIU > &)
 
- Public Member Functions inherited from chronIntIdRes< baseNMIU >
 chronIntIdRes ()
 
- Public Member Functions inherited from chronIntId
 chronIntId (const unsigned &idIn)
 
- Public Member Functions inherited from intId< unsigned, 8u, sizeof(unsigned)*CHAR_BIT >
 intId (const unsigned &idIn)
 
bool operator== (const intId &idIn) const
 
resTableIndex hash () const
 
const unsigned getId () const
 
- Public Member Functions inherited from tsSLNode< baseNMIU >
 tsSLNode ()
 
tsSLNode< baseNMIU > & operator= (const tsSLNode< baseNMIU > &)
 

Static Public Member Functions

static netSubscriptionfactory (tsFreeList< class netSubscription, 1024, epicsMutexNOOP > &, class privateInterfaceForIO &, unsigned type, arrayElementCount count, unsigned mask, cacStateNotify &)
 

Protected Member Functions

 netSubscription (class privateInterfaceForIO &, unsigned type, arrayElementCount count, unsigned mask, cacStateNotify &)
 
 ~netSubscription ()
 
- Protected Member Functions inherited from baseNMIU
NETIO_VIRTUAL_DESTRUCTOR ~baseNMIU ()
 

Additional Inherited Members

- Public Attributes inherited from baseNMIU
virtual void exception epicsGuard< epicsMutex > cacRecycle int status
 
virtual void exception epicsGuard< epicsMutex > cacRecycle int const char * pContext = 0
 
virtual void exception epicsGuard< epicsMutex > cacRecycle int const char unsigned type
 
virtual void exception epicsGuard< epicsMutex > cacRecycle int const char unsigned arrayElementCount count = 0
 
- Protected Attributes inherited from intId< unsigned, 8u, sizeof(unsigned)*CHAR_BIT >
unsigned id
 

Detailed Description

Definition at line 74 of file netIO.h.

Constructor & Destructor Documentation

netSubscription::netSubscription ( class privateInterfaceForIO chanIn,
unsigned  type,
arrayElementCount  count,
unsigned  mask,
cacStateNotify notifyIn 
)
protected

Definition at line 33 of file netSubscription.cpp.

36  :
37  count ( countIn ), privateChanForIO ( chanIn ),
38  notify ( notifyIn ), type ( typeIn ), mask ( maskIn ),
39  subscribed ( false )
40 {
41  if ( ! dbr_type_is_valid ( typeIn ) ) {
42  throw cacChannel::badType ();
43  }
44  if ( this->mask == 0u ) {
46  }
47 }
#define dbr_type_is_valid(type)
Definition: db_access.h:644
netSubscription::~netSubscription ( )
protected

Definition at line 49 of file netSubscription.cpp.

50 {
51 }

Member Function Documentation

netSubscription * netSubscription::factory ( tsFreeList< class netSubscription, 1024, epicsMutexNOOP > &  freeList,
class privateInterfaceForIO chan,
unsigned  type,
arrayElementCount  count,
unsigned  mask,
cacStateNotify notify 
)
inlinestatic

Definition at line 231 of file netIO.h.

235 {
236  return new ( freeList ) netSubscription ( chan, type,
237  count, mask, notify );
238 }
arrayElementCount netSubscription::getCount ( epicsGuard< epicsMutex > &  guard,
bool  allow_zero 
) const
inline

Definition at line 240 of file netIO.h.

242 {
243  //guard.assertIdenticalMutex ( this->mutex );
244  arrayElementCount nativeCount = this->privateChanForIO.nativeElementCount ( guard );
245  if ( (this->count == 0u && !allow_zero) || this->count > nativeCount ) {
246  return nativeCount;
247  }
248  else {
249  return this->count;
250  }
251 }
virtual arrayElementCount nativeElementCount(epicsGuard< epicsMutex > &) const =0
unsigned long arrayElementCount
Definition: cacIO.h:57
unsigned netSubscription::getMask ( epicsGuard< epicsMutex > &  ) const
inline

Definition at line 258 of file netIO.h.

259 {
260  return this->mask;
261 }
unsigned netSubscription::getType ( epicsGuard< epicsMutex > &  ) const
inline

Definition at line 253 of file netIO.h.

254 {
255  return this->type;
256 }
void netSubscription::show ( unsigned  level) const
virtual

Implements baseNMIU.

Definition at line 65 of file netSubscription.cpp.

66 {
67  ::printf ( "event subscription IO at %p, type %s, element count %lu, mask %u\n",
68  static_cast < const void * > ( this ),
69  dbf_type_to_text ( static_cast < int > ( this->type ) ),
70  this->count, this->mask );
71 }
#define dbf_type_to_text(type)
Definition: db_access.h:677
#define printf
Definition: epicsStdio.h:41
void netSubscription::show ( epicsGuard< epicsMutex > &  ,
unsigned  level 
) const
virtual

Implements baseNMIU.

Definition at line 73 of file netSubscription.cpp.

75 {
76  this->show ( level );
77 }
void show(unsigned level) const
void netSubscription::subscribeIfRequired ( epicsGuard< epicsMutex > &  guard,
nciu chan 
)

Definition at line 144 of file netSubscription.cpp.

146 {
147  if ( ! this->subscribed ) {
148  chan.getPIIU(guard)->subscriptionRequest (
149  guard, chan, *this );
150  this->subscribed = true;
151  }
152 }
virtual void subscriptionRequest(epicsGuard< epicsMutex > &, nciu &, netSubscription &)=0
Definition: netiiu.cpp:76
netiiu * getPIIU(epicsGuard< epicsMutex > &)
Definition: nciu.h:321
void netSubscription::unsubscribeIfRequired ( epicsGuard< epicsMutex > &  guard,
nciu chan 
)

Definition at line 154 of file netSubscription.cpp.

156 {
157  if ( this->subscribed ) {
158  chan.getPIIU(guard)->subscriptionCancelRequest (
159  guard, chan, *this );
160  this->subscribed = false;
161  }
162 }
virtual void subscriptionCancelRequest(epicsGuard< epicsMutex > &, nciu &chan, netSubscription &subscr)=0
Definition: netiiu.cpp:81
netiiu * getPIIU(epicsGuard< epicsMutex > &)
Definition: nciu.h:321

The documentation for this class was generated from the following files: