moved someof the functionality into the old interface

This commit is contained in:
Jeff Hill
2002-05-09 00:28:40 +00:00
parent 3c5f460e0f
commit 0f58a2eb39
2 changed files with 2 additions and 59 deletions
+2 -42
View File
@@ -47,10 +47,7 @@ nciu::nciu ( cac & cacIn, netiiu & iiuIn, cacChannelNotify & chanIn,
typeCode ( USHRT_MAX ),
priority ( static_cast <ca_uint8_t> ( pri ) ),
f_connected ( false ),
f_previousConn ( false ),
f_claimSent ( false ),
f_firstConnectDecrementsOutstandingIO ( false ),
f_connectTimeOutSeen ( false )
f_claimSent ( false )
{
size_t nameLengthTmp = strlen ( pNameIn ) + 1;
@@ -74,12 +71,6 @@ nciu::~nciu ()
// care is taken so that a lock is not applied during this phase
this->cacCtx.uninstallChannel ( *this );
if ( ! this->f_connectTimeOutSeen && ! this->f_previousConn ) {
if ( this->f_firstConnectDecrementsOutstandingIO ) {
this->cacCtx.decrementOutstandingIO ();
}
}
delete [] this->pNameStr;
}
@@ -112,17 +103,10 @@ void nciu::connect ( unsigned nativeType,
return;
}
if ( ! this->f_connectTimeOutSeen && ! this->f_previousConn ) {
if ( this->f_firstConnectDecrementsOutstandingIO ) {
this->cacCtx.decrementOutstandingIO ();
}
}
this->typeCode = static_cast < unsigned short > ( nativeType );
this->count = nativeCount;
this->sid = sidIn;
this->f_connected = true;
this->f_previousConn = true;
/*
* if less than v4.1 then the server will never
@@ -328,7 +312,6 @@ void nciu::hostName ( char *pBuf, unsigned bufLength ) const
// deprecated - please do not use, this is _not_ thread safe
const char * nciu::pHostName () const
{
epicsGuard < cacMutex > locker ( this->cacCtx.mutexRef() );
return this->piiu->pHostName (); // ouch !
}
@@ -387,26 +370,6 @@ double nciu::beaconPeriod () const
return this->cacCtx.beaconPeriod ( *this );
}
void nciu::notifyStateChangeFirstConnectInCountOfOutstandingIO ()
{
epicsGuard < cacMutex > locker ( this->cacCtx.mutexRef() );
// test is performed via a callback so that locking is correct
if ( ! this->f_connectTimeOutSeen && ! this->f_previousConn ) {
if ( this->notify ().includeFirstConnectInCountOfOutstandingIO () ) {
if ( ! this->f_firstConnectDecrementsOutstandingIO ) {
this->cacCtx.incrementOutstandingIO ();
this->f_firstConnectDecrementsOutstandingIO = true;
}
}
else {
if ( this->f_firstConnectDecrementsOutstandingIO ) {
this->cacCtx.decrementOutstandingIO ();
this->f_firstConnectDecrementsOutstandingIO = false;
}
}
}
}
void nciu::show ( unsigned level ) const
{
epicsGuard < cacMutex > locker ( this->cacCtx.mutexRef() );
@@ -425,11 +388,8 @@ void nciu::show ( unsigned level ) const
}
::printf ( "\n" );
}
else if ( this->f_previousConn ) {
::printf ( "Channel \"%s\" (previously connected to a server)\n", this->pNameStr );
}
else {
::printf ( "Channel \"%s\" (unable to locate server)\n", this->pNameStr );
::printf ( "Channel \"%s\" is disconnected\n", this->pNameStr );
}
if ( level > 2u ) {
-17
View File
@@ -85,17 +85,14 @@ public:
void searchReplySetUp ( netiiu &iiu, unsigned sidIn,
ca_uint16_t typeIn, arrayElementCount countIn );
void show ( unsigned level ) const;
void connectTimeoutNotify ();
const char *pName () const;
unsigned nameLen () const;
const char * pHostName () const; // deprecated - please do not use
arrayElementCount nativeElementCount () const;
bool connected () const;
bool previouslyConnected () const;
void writeException ( epicsGuard < callbackMutex > &,
int status, const char *pContext, unsigned type, arrayElementCount count );
cacChannel::priLev getPriority () const;
void notifyStateChangeFirstConnectInCountOfOutstandingIO ();
private:
caAccessRights accessRightState;
cac & cacCtx;
@@ -109,10 +106,7 @@ private:
ca_uint16_t typeCode;
ca_uint8_t priority;
bool f_connected:1;
bool f_previousConn:1; // T if connected in the past
bool f_claimSent:1;
bool f_firstConnectDecrementsOutstandingIO:1;
bool f_connectTimeOutSeen:1;
void initiateConnect ();
ioStatus read ( unsigned type, arrayElementCount count,
cacReadNotify &, ioid * );
@@ -196,17 +190,11 @@ inline bool nciu::connected () const
return this->f_connected;
}
inline bool nciu::previouslyConnected () const
{
return this->f_previousConn;
}
inline netiiu * nciu::getPIIU ()
{
return this->piiu;
}
inline void nciu::writeException ( epicsGuard < callbackMutex > &, int status,
const char *pContext, unsigned typeIn, arrayElementCount countIn )
{
@@ -238,11 +226,6 @@ inline cac & nciu::getClient ()
return this->cacCtx;
}
inline void nciu::connectTimeoutNotify ()
{
this->f_connectTimeOutSeen = true;
}
inline cacChannel::priLev nciu::getPriority () const
{
return this->priority;