]> SALOME platform Git repositories - modules/yacs.git/blob - src/SALOMEDSImpl/SALOMEDSImpl_Callback.hxx
Salome HOME
PR: merge from branch BR_UnitTests tag mergeto_trunk_17oct05
[modules/yacs.git] / src / SALOMEDSImpl / SALOMEDSImpl_Callback.hxx
1 //  File   : SALOMEDSImpl_Callback.hxx
2 //  Author : Sergey RUIN
3 //  Module : SALOME
4
5 #ifndef __SALOMEDSIMPL_CALLBACK_H__
6 #define __SALOMEDSIMPL_CALLBACK_H__
7
8 //Handle definition
9 #include <Handle_MMgt_TShared.hxx>
10 #include <Standard_DefineHandle.hxx>
11 DEFINE_STANDARD_HANDLE( SALOMEDSImpl_Callback, MMgt_TShared )
12
13 #include "SALOMEDSImpl_UseCaseBuilder.hxx"
14
15 class SALOMEDSImpl_Callback : public MMgt_TShared  
16 {
17 private:
18   Handle(SALOMEDSImpl_UseCaseBuilder) _builder;
19
20 public:
21
22  SALOMEDSImpl_Callback(const Handle(SALOMEDSImpl_UseCaseBuilder)& builder) 
23  {
24    _builder = builder;
25  }
26
27  virtual void OnAddSObject(Handle(SALOMEDSImpl_SObject) theObject) 
28  {
29    if(_builder != NULL && theObject != NULL) _builder->Append(theObject);
30  }
31
32  virtual void OnRemoveSObject(Handle(SALOMEDSImpl_SObject) theObject) 
33  {
34    if(_builder != NULL && theObject != NULL) _builder->Remove(theObject);
35  }
36
37 public:
38   DEFINE_STANDARD_RTTI( SALOMEDSImpl_Callback )
39
40 };
41
42 #endif