diff --git a/src/cas/generic/casChannel.cc b/src/cas/generic/casChannel.cc index f9aa5e990..17679acb9 100644 --- a/src/cas/generic/casChannel.cc +++ b/src/cas/generic/casChannel.cc @@ -29,6 +29,9 @@ * * History * $Log$ + * Revision 1.1.1.1 1996/06/20 00:28:14 jhill + * ca server installation + * * */ @@ -54,7 +57,7 @@ casChannel::~casChannel() casPV *casChannel::getPV() { - casPVI &pvi((*this)->getPVI()); + casPVI &pvi(this->casChannelI::getPVI()); if (&pvi!=NULL) { return pvi.intefaceObjectPointer(); @@ -69,7 +72,7 @@ casPV *casChannel::getPV() // void casChannel::postEvent (const casEventMask &select, gdd &event) { - (*this)->postEvent(select, event); + this->casChannelI::postEvent(select, event); } // diff --git a/src/cas/generic/casChannelIIL.h b/src/cas/generic/casChannelIIL.h index fd17e1618..7627b679a 100644 --- a/src/cas/generic/casChannelIIL.h +++ b/src/cas/generic/casChannelIIL.h @@ -29,6 +29,9 @@ * * History * $Log$ + * Revision 1.1.1.1 1996/06/20 00:28:16 jhill + * ca server installation + * * */ @@ -122,10 +125,10 @@ inline void casChannelI::clientDestroy() (*this)->destroy(); } -#include // casPVI inline func (for getIOOPSInProgress() ) +#include // -// functions that use below here casPVIIL.h +// functions that use casPVIIL.h below here // // @@ -150,14 +153,6 @@ inline void casChannelI::removeAsyncIO(casAsyncIOI &io) this->unlock(); } -// -// casChannelI::getIOOPSInProgress() -// -inline unsigned casChannelI::getIOOPSInProgress() const -{ - return this->pv.ioInProgress(); -} - // // casChannelI::getSID() // fetch the unsigned integer server id for this PV diff --git a/src/cas/generic/casInternal.h b/src/cas/generic/casInternal.h index 113e745e6..fac4bd557 100644 --- a/src/cas/generic/casInternal.h +++ b/src/cas/generic/casInternal.h @@ -29,6 +29,9 @@ * * History * $Log$ + * Revision 1.4 1996/06/26 23:32:17 jhill + * changed where caProto.h comes from (again) + * * Revision 1.3 1996/06/26 21:18:54 jhill * now matches gdd api revisions * @@ -443,8 +446,6 @@ public: // inline casMonitor *findMonitor(const caResId clientIdIn); - inline unsigned getIOOPSInProgress() const; - casPVI &getPVI() const { return this->pv; @@ -504,7 +505,6 @@ class casPVI : public ioBlockedList // list of clients io blocked on this pv { public: - // // The PV name here must be the canonical and unique name // for the PV in this system @@ -537,14 +537,6 @@ public: inline void registerIO(); inline void unregisterIO(); - // - // how many async IOs are outstanding? - // - unsigned ioInProgress() const - { - return this->nIOAttached; - } - // // only for use by casChannelI // @@ -564,7 +556,7 @@ public: inline void postEvent (const casEventMask &select, gdd &event); - casPV *intefaceObjectPointer() + casPV *intefaceObjectPointer() const { return (casPV *) this; } @@ -573,17 +565,20 @@ public: // casPVI must always be a base for casPV // (the constructor assert fails if this isnt the case) // - casPV * operator -> () + casPV * operator -> () const { return intefaceObjectPointer(); } caServer *getExtServer(); + // // bestDBRType() // - inline caStatus bestDBRType (unsigned &dbrType); + inline caStatus bestDBRType (unsigned &dbrType); + + inline aitBool okToBeginNewIO() const; inline void lock(); inline void unlock(); diff --git a/src/cas/generic/casMonitor.cc b/src/cas/generic/casMonitor.cc index e5a58f993..85ffe058c 100644 --- a/src/cas/generic/casMonitor.cc +++ b/src/cas/generic/casMonitor.cc @@ -29,6 +29,9 @@ * * History * $Log$ + * Revision 1.2 1996/06/26 21:18:56 jhill + * now matches gdd api revisions + * * Revision 1.1.1.1 1996/06/20 00:28:16 jhill * ca server installation * @@ -66,7 +69,7 @@ casMonitor::casMonitor(caResId clientIdIn, casChannelI &chan, this->ciu.addMonitor(*this); - this->enable(); + this->enable(); } // @@ -77,6 +80,9 @@ casMonitor::~casMonitor() casCoreClient &client = this->ciu.getClient(); this->mutex.lock(); + + this->disable(); + // // remove from the event system // diff --git a/src/cas/generic/casPV.cc b/src/cas/generic/casPV.cc index a69d3aad1..c1f0f6563 100644 --- a/src/cas/generic/casPV.cc +++ b/src/cas/generic/casPV.cc @@ -29,6 +29,9 @@ * * History * $Log$ + * Revision 1.2 1996/06/21 02:30:53 jhill + * solaris port + * * Revision 1.1.1.1 1996/06/20 00:28:15 jhill * ca server installation * @@ -152,7 +155,7 @@ void casPV::destroy() // void casPV::postEvent (const casEventMask &select, gdd &event) { - (*this)->postEvent (select, event); + this->casPVI::postEvent (select, event); } // @@ -166,6 +169,6 @@ void casPV::postEvent (const casEventMask &select, gdd &event) // caServer *casPV::getCAS() { - return (*this)->getExtServer(); + return this->casPVI::getExtServer(); } diff --git a/src/cas/generic/casPVI.cc b/src/cas/generic/casPVI.cc index 8b95ff337..af6f4d6c2 100644 --- a/src/cas/generic/casPVI.cc +++ b/src/cas/generic/casPVI.cc @@ -29,6 +29,9 @@ * * History * $Log$ + * Revision 1.2 1996/06/26 21:18:57 jhill + * now matches gdd api revisions + * * Revision 1.1.1.1 1996/06/20 00:28:15 jhill * ca server installation * @@ -182,3 +185,4 @@ caServer *casPVI::getExtServer() return this->cas.getAdapter(); } + diff --git a/src/cas/generic/casPVIIL.h b/src/cas/generic/casPVIIL.h index 1e1334f06..21e53ab07 100644 --- a/src/cas/generic/casPVIIL.h +++ b/src/cas/generic/casPVIIL.h @@ -29,6 +29,9 @@ * * History * $Log$ + * Revision 1.3 1996/06/26 21:18:58 jhill + * now matches gdd api revisions + * * Revision 1.2 1996/06/21 02:30:55 jhill * solaris port * @@ -80,13 +83,27 @@ inline void casPVI::removeChannel(casPVListChan &chan) this->unlock(); } +// +// okToBeginNewIO() +// +inline aitBool casPVI::okToBeginNewIO() const +{ + if (this->nIOAttached >= (*this)->maxSimultAsyncOps()) + { + return aitFalse; + } + else { + return aitTrue; + } +} + // // casPVI::registerIO() // inline void casPVI::registerIO() { this->lock(); - casVerify (this->nIOAttached <= (*this)->maxSimultAsyncOps()); + casVerify (this->nIOAttached < (*this)->maxSimultAsyncOps()); this->nIOAttached++; this->unlock(); } @@ -161,6 +178,7 @@ inline void casPVI::postEvent (const casEventMask &select, gdd &event) } } + #endif // casPVIIL_h diff --git a/src/cas/generic/casStrmClient.cc b/src/cas/generic/casStrmClient.cc index 4e97900fb..bef689fcd 100644 --- a/src/cas/generic/casStrmClient.cc +++ b/src/cas/generic/casStrmClient.cc @@ -29,6 +29,9 @@ * * History * $Log$ + * Revision 1.3 1996/06/26 21:18:59 jhill + * now matches gdd api revisions + * * Revision 1.2 1996/06/21 02:30:57 jhill * solaris port * @@ -85,13 +88,13 @@ inline caStatus casStrmClient::verifyRequest (casChannelI *&pChan) // then we will need to wait until later to initiate this // request. // - if (pChan->getIOOPSInProgress() >= - pChan->getPVI()->maxSimultAsyncOps()) { + if (pChan->getPVI().okToBeginNewIO()!=aitTrue) { this->ioBlocked::setBlocked (pChan->getPVI()); return S_cas_ioBlocked; + } + else { + return S_cas_validRequest; } - - return S_cas_validRequest; } @@ -1663,7 +1666,6 @@ caStatus casStrmClient::createChanResponse(casChannelI *, // casPVI *caServerI::createPV (gdd &name) { - aitString *pAITStr; casPVI *pPVI; caStatus status; @@ -1675,15 +1677,23 @@ casPVI *caServerI::createPV (gdd &name) return NULL; } - name.getRef (pAITStr); - stringId id (pAITStr->string()); + // + // this assumes that they did a put() + // and not a putRef() + // + // if this assumption is wrong (and there is no + // way currently to test) it will prove fatal + // to the server + // + aitString aitStr(name); + stringId id (aitStr.string()); this->lock (); pPVI = this->stringResTbl.lookup (id); if (!pPVI) { casPV *pPV; - pPV = (*this)->createPV (this->ctx, pAITStr->string()); + pPV = (*this)->createPV (this->ctx, aitStr.string()); if (pPV) { pPVI = (casPVI *) pPV; } diff --git a/src/cas/generic/casdef.h b/src/cas/generic/casdef.h index 62793e6e7..8cd44665e 100644 --- a/src/cas/generic/casdef.h +++ b/src/cas/generic/casdef.h @@ -30,6 +30,9 @@ * Modification Log: * ----------------- * $Log$ + * Revision 1.3 1996/06/26 23:08:55 jhill + * took path out of casInternal.h include + * * Revision 1.2 1996/06/20 18:09:43 jhill * changed where casInternal comes from * @@ -209,7 +212,7 @@ public: // caStatus postIOCompletion(caStatus completionStatusIn, gdd *pValue=0) { - return (*this)->postIOCompletion(completionStatusIn, pValue); + return this->casAsyncIOI::postIOCompletion(completionStatusIn, pValue); } // @@ -221,7 +224,7 @@ public: // caServer *getCAS() { - return (*this)->getCAS(); + return this->casAsyncIOI::getCAS(); } // @@ -231,7 +234,7 @@ public: // gdd *getValuePtr () { - return (*this)->getValuePtr(); + return this->casAsyncIOI::getValuePtr(); } // @@ -242,12 +245,7 @@ public: // void clrValue() { - (*this)->clrValue(); - } -private: - casAsyncIOI * operator -> () - { - return (casAsyncIOI *) this; + this->casAsyncIOI::clrValue(); } }; @@ -257,8 +255,12 @@ private: class caServer { private: // - // private reference here inorder to avoid os - // dependent -I during server tool compile + // this private data member appears first so that + // initialization of the constant event masks below + // uses this member only after it has been intialized + // + // We do not use private inheritance here in order + // to avoid os/io dependent -I during server tool compile // caServerI *pCAS; public: @@ -278,13 +280,6 @@ public: casEventMask registerEvent (const char *pName); - // - // for use when mapping between an event id and an event - // name. Event ids are used to select events. - // - //caEventId eventId (const char *pEventName, const gdd &prototype); - //const char *eventName (const caEventId &id); - // // show() // @@ -346,10 +341,6 @@ public: casPV (const casCtx &ctx, const char * const pPVName); virtual ~casPV (); - // - // Need VF that returns pointer to derived type ? - // - // // This is called for each PV in the server if // caServer::show() is called and the level is high @@ -463,12 +454,6 @@ public: // *************** // caServer *getCAS(); - -private: - casPVI * operator -> () - { - return (casPVI *) this; - } }; // @@ -548,11 +533,6 @@ public: // *************** // casPV *getPV(); -private: - casChannelI * operator -> () - { - return (casChannelI *) this; - } }; #endif /* ifdef includecasdefh (this must be the last line in this file) */