Salome HOME
OK thanks to INV !
[modules/med.git] / src / MEDCoupling / MEDCouplingRefCountObject.cxx
index ab245084ef27624e3b15d4a6b72bcbf05f640412..443ae2cd8ff584b590f3cd78cd9cea3fec935eb7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2013  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+// Author : Anthony Geay (CEA/DEN)
 
 #include "MEDCouplingRefCountObject.hxx"
+#include "MED_version.h"
 
 using namespace ParaMEDMEM;
 
+const char *ParaMEDMEM::MEDCouplingVersionStr()
+{
+  return SALOMEMED_VERSION_STR;
+}
+
+int ParaMEDMEM::MEDCouplingVersion()
+{
+  return SALOMEMED_VERSION;
+}
+
+void ParaMEDMEM::MEDCouplingVersionMajMinRel(int& maj, int& minor, int& releas)
+{
+  int ver=SALOMEMED_VERSION;
+  maj=(ver & 0xFF0000) >> 16;
+  minor=(ver & 0xFF00) >> 8;
+  releas=(ver & 0xFF);
+}
+
+int ParaMEDMEM::MEDCouplingSizeOfVoidStar()
+{
+  return 8*sizeof(std::size_t);
+}
+
 RefCountObject::RefCountObject():_cnt(1)
 {
 }
@@ -29,6 +54,15 @@ RefCountObject::RefCountObject(const RefCountObject& other):_cnt(1)
 {
 }
 
+/*!
+ * Do nothing here ! It is not a bug ( I hope :) ) because all subclasses that
+ * copies using operator= should not copy the ref counter of \a other !
+ */
+RefCountObject& RefCountObject::operator=(const RefCountObject& other)
+{
+  return *this;
+}
+
 bool RefCountObject::decrRef() const
 {
   bool ret=((--_cnt)==0);
@@ -42,6 +76,11 @@ void RefCountObject::incrRef() const
   _cnt++;
 }
 
+int RefCountObject::getRCValue() const
+{
+  return _cnt;
+}
+
 RefCountObject::~RefCountObject()
 {
 }