Salome HOME
add method NameChanged to update title name
[modules/kernel.git] / src / SALOMESDS / SALOMESDS_PickelizedPyObjRdExtInitServer.hxx
index 25f94d6f783999a06115d2b1df9152a11282f07b..5845c7aca1a99400116cc88170e743cd768deba8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -30,6 +30,9 @@
 
 namespace SALOMESDS
 {
+  /*!
+   * State during the producer/consumer phase. Activated by TransactionMultiKeyAddSession transaction returned by dss.addMultiKeyValueSession.
+   */
   class PickelizedPyObjRdExtInitServer : public PickelizedPyObjServerModifiable, public virtual POA_SALOME::PickelizedPyObjRdExtInitServer
   {
   public:
@@ -39,10 +42,15 @@ namespace SALOMESDS
   public:
     std::string getAccessStr() const;
     SALOME::ByteVec *fetchSerializedContent();
+  public:
+    void incrNbClients() const { _nb_of_clients++; }
+    bool decrNbClients() const { _nb_of_clients--; return _nb_of_clients<=0; }
   private:
     static PyObject *DeepCopyPyObj(PyObject *pyobj);
   private:
     PyObject *_self_deep_copy;
+    //! this attribute stores number of clients in RdExtInit/RdExt
+    mutable int _nb_of_clients;
   public:
     static const char ACCESS_REPR[];
   };