From: rahuel Date: Wed, 19 Oct 2005 09:45:49 +0000 (+0000) Subject: Methods to check of instances of components X-Git-Tag: V3_1_0a3~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d729edc26ea426594f39b49f08f186b33350f987;p=samples%2Fcomponent.git Methods to check of instances of components --- diff --git a/src/SyrComponent/SyrComponent_Impl.cxx b/src/SyrComponent/SyrComponent_Impl.cxx index 085cfd9..c4bd484 100755 --- a/src/SyrComponent/SyrComponent_Impl.cxx +++ b/src/SyrComponent/SyrComponent_Impl.cxx @@ -141,6 +141,31 @@ long SyrComponent_Impl::C_INCR( const long aCount ) { return ( aCount + 1 ) ; } +void SyrComponent_Impl::CPP_SETLONG( const long aCount ) { + beginService( " SyrComponent_Impl::CPP_SETLONG" ); + sendMessage(NOTIF_STEP, "SyrComponent_Impl::CPP_SETLONG is Computing"); +// int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); + int S = 1 ; + while ( S ) { + S = sleep(S); + } + _Count = aCount ; + endService( " SyrComponent_Impl::CPP_SETLONG" ); + return ; +} + +long SyrComponent_Impl::CPP_ADDTOLONG( const long anIncr ) { + beginService( " SyrComponent_Impl::CPP_ADDTOLONG" ); + sendMessage(NOTIF_STEP, "SyrComponent_Impl::CPP_ADDTOLONG is Computing"); +// int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); + int S = 1 ; + while ( S ) { + S = sleep(S); + } + endService( " SyrComponent_Impl::CPP_ADDTOLONG" ); + return ( _Count + anIncr ) ; +} + long SyrComponent_Impl::C_MIN( const long aMinVal , const long anInteger ) { beginService( " SyrComponent_Impl::C_MIN" ); sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_MIN is Computing"); diff --git a/src/SyrComponent/SyrComponent_Impl.hxx b/src/SyrComponent/SyrComponent_Impl.hxx index e4291df..80921e6 100755 --- a/src/SyrComponent/SyrComponent_Impl.hxx +++ b/src/SyrComponent/SyrComponent_Impl.hxx @@ -60,6 +60,10 @@ public: virtual long C_INCR( const long aCount ) ; + virtual void CPP_SETLONG( const long aLong ) ; + + virtual long CPP_ADDTOLONG( const long anIncr ) ; + virtual long C_MIN( const long aMinVal , const long anInteger ) ; virtual long C_MAX( const long aMaxVal , const long anInteger ) ; @@ -76,6 +80,7 @@ public: private: + long _Count ; }; class ListOfSyr_Impl : public POA_SuperVisionTest::ListOfSyr ,