certi-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[certi-cvs] certi/libCERTI GAV.cc GAV.hh


From: certi-cvs
Subject: [certi-cvs] certi/libCERTI GAV.cc GAV.hh
Date: Sat, 04 Apr 2009 13:53:26 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     Petr Gotthard <gotthardp>       09/04/04 13:53:26

Modified files:
        libCERTI       : GAV.cc GAV.hh 

Log message:
        Bug #24930: Do not inherit from std::<Container> classes to avoid link 
error under Visual Studio 9.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/GAV.cc?cvsroot=certi&r1=3.19&r2=3.20
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/GAV.hh?cvsroot=certi&r1=3.14&r2=3.15

Patches:
Index: GAV.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/GAV.cc,v
retrieving revision 3.19
retrieving revision 3.20
diff -u -b -r3.19 -r3.20
--- GAV.cc      2 Apr 2009 19:58:08 -0000       3.19
+++ GAV.cc      4 Apr 2009 13:53:25 -0000       3.20
@@ -16,7 +16,7 @@
 // License along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: GAV.cc,v 3.19 2009/04/02 19:58:08 erk Exp $
+// $Id: GAV.cc,v 3.20 2009/04/04 13:53:25 gotthardp Exp $
 // ----------------------------------------------------------------------------
 
 #include "GAV.hh"
@@ -75,7 +75,7 @@
 ULong
 AttributeHandleValuePairSet::size() const
 {
-    return list<AttributeHandleValuePair *>::size();
+    return _set.size();
 }
 
 // ----------------------------------------------------------------------------
@@ -83,8 +83,8 @@
 AttributeHandleValuePairSet::getHandle(ULong i) const
     throw (ArrayIndexOutOfBounds)
 {
-    list<AttributeHandleValuePair *>::const_iterator j = begin();
-    for (ULong k = 0 ; j != end(); j++, k++) {
+    list<AttributeHandleValuePair *>::const_iterator j = _set.begin();
+    for (ULong k = 0 ; j != _set.end(); j++, k++) {
         if (i == k)
             return (*j)->_handle ;
     }
@@ -97,8 +97,8 @@
 AttributeHandleValuePairSet::getValueLength(ULong i) const
     throw (ArrayIndexOutOfBounds)
 {
-    list<AttributeHandleValuePair *>::const_iterator j = begin();
-    for (ULong k = 0 ; j != end(); j++, k++) {
+    list<AttributeHandleValuePair *>::const_iterator j = _set.begin();
+    for (ULong k = 0 ; j != _set.end(); j++, k++) {
         if (i == k)
             return (*j)->_valueLength ;
     }
@@ -113,8 +113,8 @@
                                          ULong& value_length) const
     throw (ArrayIndexOutOfBounds)
 {
-    list<AttributeHandleValuePair *>::const_iterator j = begin();
-    for (ULong k = 0 ; j != end(); j++, k++) {
+    list<AttributeHandleValuePair *>::const_iterator j = _set.begin();
+    for (ULong k = 0 ; j != _set.end(); j++, k++) {
         if (i == k) {
             value_length = (*j)->_valueLength ;
             memcpy(buff, (*j)->_value, (*j)->_valueLength);
@@ -131,8 +131,8 @@
                                                 ULong& value_length) const
     throw (ArrayIndexOutOfBounds)
 {
-    list<AttributeHandleValuePair *>::const_iterator j = begin();
-    for (ULong k = 0 ; j != end(); j++, k++) {
+    list<AttributeHandleValuePair *>::const_iterator j = _set.begin();
+    for (ULong k = 0 ; j != _set.end(); j++, k++) {
         if (i == k) {
             value_length = (*j)->_valueLength ;
             return (*j)->_value ;
@@ -168,7 +168,7 @@
     AttributeHandleValuePair *ahvp ;
     ahvp = new AttributeHandleValuePair(h, buff, value_length);
 
-    push_front(ahvp);
+    _set.push_front(ahvp);
 }
 
 // ----------------------------------------------------------------------------
@@ -177,10 +177,10 @@
     throw (ArrayIndexOutOfBounds)
 {
     list<AttributeHandleValuePair *>::iterator j ;
-    for (j = begin(); j != end(); j++) {
+    for (j = _set.begin(); j != _set.end(); j++) {
         if ((*j)->_handle == h) {
             delete (*j);
-            erase(j);
+            _set.erase(j);
             return ;
         }
     }
@@ -201,9 +201,9 @@
 void
 AttributeHandleValuePairSet::empty()
 {
-    while (!list<AttributeHandleValuePair *>::empty()) {
-        delete front();
-        pop_front();
+    while (!_set.empty()) {
+        delete _set.front();
+        _set.pop_front();
     }
 }
 
@@ -247,7 +247,7 @@
 inline ULong
 AttributeHandleSet::size() const
 {
-    return list<AttributeHandle>::size();
+    return _set.size();
 }
 
 // ----------------------------------------------------------------------------
@@ -257,7 +257,7 @@
 {
     list<AttributeHandle>::const_iterator h ;
     ULong j ;
-    for (j = 0, h = begin(); h != end(); h++, j++) {
+    for (j = 0, h = _set.begin(); h != _set.end(); h++, j++) {
         if (i == j)
             return (*h);
     }
@@ -270,7 +270,7 @@
 AttributeHandleSet::add(AttributeHandle h)
     throw (ArrayIndexOutOfBounds, AttributeNotDefined)
 {
-    push_front(h);
+    _set.push_front(h);
 }
 
 // ----------------------------------------------------------------------------
@@ -279,7 +279,7 @@
     throw (AttributeNotDefined)// not guaranteed safe while iterating
 {
     if (isMember(h) == true)
-        list<AttributeHandle>::remove(h);
+        _set.remove(h);
     else
         throw AttributeNotDefined("");
 }
@@ -288,21 +288,21 @@
 void
 AttributeHandleSet::empty()
 {
-    list<AttributeHandle>::clear();
+    _set.clear();
 }
 
 // ----------------------------------------------------------------------------
 bool
 AttributeHandleSet::isEmpty() const
 {
-    return list<AttributeHandle>::empty();
+    return _set.empty();
 }
 
 // ----------------------------------------------------------------------------
 bool
 AttributeHandleSet::isMember(AttributeHandle h) const
 {
-    return find(begin(), end(), h) != end();
+    return find(_set.begin(), _set.end(), h) != _set.end();
 }
 
 // ----------------------------------------------------------------------------
@@ -317,7 +317,7 @@
 inline ULong
 FederateHandleSet::size() const
 {
-    return list<FederateHandle>::size();
+    return _set.size();
 }
 
 // ----------------------------------------------------------------------------
@@ -327,7 +327,7 @@
 {
     list<FederateHandle>::const_iterator h ;
     ULong j ;
-    for (j = 0, h = begin(); h != end(); h++, j++) {
+    for (j = 0, h = _set.begin(); h != _set.end(); h++, j++) {
         if (i == j)
             return (*h);
     }
@@ -340,7 +340,7 @@
 FederateHandleSet::add(FederateHandle h)
     throw (ValueCountExceeded)
 {
-    push_front(h);
+    _set.push_front(h);
 }
 
 // ----------------------------------------------------------------------------
@@ -349,7 +349,7 @@
     throw (ArrayIndexOutOfBounds)
 {
     if (isMember(h) == true)
-        list<FederateHandle>::remove(h);
+        _set.remove(h);
     else
         throw AttributeNotDefined("");
 }
@@ -358,14 +358,14 @@
 void
 FederateHandleSet::empty()
 {
-    list<FederateHandle>::clear();
+    _set.clear();
 }
 
 // ----------------------------------------------------------------------------
 bool
 FederateHandleSet::isMember(FederateHandle h) const
 {
-    return find(begin(), end(), h) != end();
+    return find(_set.begin(), _set.end(), h) != _set.end();
 }
 
 // ----------------------------------------------------------------------------
@@ -407,7 +407,7 @@
 ULong
 ParameterHandleValuePairSet::size() const
 {
-    return list<ParameterHandleValuePair *>::size();
+    return _set.size();
 }
 
 // ----------------------------------------------------------------------------
@@ -415,8 +415,8 @@
 ParameterHandleValuePairSet::getHandle(ULong i) const
     throw (ArrayIndexOutOfBounds)
 {
-    list<ParameterHandleValuePair *>::const_iterator j = begin();
-    for (ULong k = 0 ; j != end(); j++, k++) {
+    list<ParameterHandleValuePair *>::const_iterator j = _set.begin();
+    for (ULong k = 0 ; j != _set.end(); j++, k++) {
         if (i == k)
             return (*j)->_handle ;
     }
@@ -429,8 +429,8 @@
 ParameterHandleValuePairSet::getValueLength(ULong i) const
     throw (ArrayIndexOutOfBounds)
 {
-    list<ParameterHandleValuePair *>::const_iterator j = begin();
-    for (ULong k = 0 ; j != end(); j++, k++) {
+    list<ParameterHandleValuePair *>::const_iterator j = _set.begin();
+    for (ULong k = 0 ; j != _set.end(); j++, k++) {
         if (i == k)
             return (*j)->_valueLength ;
     }
@@ -445,8 +445,8 @@
                                          ULong& value_length) const
     throw (ArrayIndexOutOfBounds)
 {
-    list<ParameterHandleValuePair *>::const_iterator j = begin();
-    for (ULong k = 0 ; j != end(); j++, k++) {
+    list<ParameterHandleValuePair *>::const_iterator j = _set.begin();
+    for (ULong k = 0 ; j != _set.end(); j++, k++) {
         if (i == k) {
             value_length = (*j)->_valueLength ;
             memcpy(buff, (*j)->_value, (*j)->_valueLength);
@@ -463,8 +463,8 @@
                                                 ULong& value_length) const
     throw (ArrayIndexOutOfBounds)
 {
-    list<ParameterHandleValuePair *>::const_iterator j = begin();
-    for (ULong k = 0 ; j != end(); j++, k++) {
+    list<ParameterHandleValuePair *>::const_iterator j = _set.begin();
+    for (ULong k = 0 ; j != _set.end(); j++, k++) {
         if (i == k) {
             value_length = (*j)->_valueLength ;
             return (*j)->_value ;
@@ -500,7 +500,7 @@
     ParameterHandleValuePair *phvp ;
     phvp = new ParameterHandleValuePair(h, buff, value_length);
 
-    push_front(phvp);
+    _set.push_front(phvp);
 }
 
 // ----------------------------------------------------------------------------
@@ -509,10 +509,10 @@
     throw (ArrayIndexOutOfBounds)
 {
     list<ParameterHandleValuePair *>::iterator j ;
-    for (j = begin(); j != end(); j++) {
+    for (j = _set.begin(); j != _set.end(); j++) {
         if ((*j)->_handle == h) {
             delete (*j);
-            erase(j);
+            _set.erase(j);
             return ;
         }
     }
@@ -533,9 +533,9 @@
 void
 ParameterHandleValuePairSet::empty()
 {
-    while (!list<ParameterHandleValuePair *>::empty()) {
-        delete front();
-        pop_front();
+    while (!_set.empty()) {
+        delete _set.front();
+        _set.pop_front();
     }
 }
 
@@ -565,5 +565,5 @@
 
 } // namespace certi
 
-// $Id: GAV.cc,v 3.19 2009/04/02 19:58:08 erk Exp $
+// $Id: GAV.cc,v 3.20 2009/04/04 13:53:25 gotthardp Exp $
 

Index: GAV.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/GAV.hh,v
retrieving revision 3.14
retrieving revision 3.15
diff -u -b -r3.14 -r3.15
--- GAV.hh      2 Apr 2009 19:58:08 -0000       3.14
+++ GAV.hh      4 Apr 2009 13:53:25 -0000       3.15
@@ -28,7 +28,6 @@
 namespace certi {
 
 class CERTI_EXPORT AttributeHandleSet
-    : public std::list<AttributeHandle>
 {
 public:
     AttributeHandleSet(ULong size);
@@ -49,9 +48,12 @@
 
     virtual bool isEmpty() const ;
     virtual bool isMember(AttributeHandle h) const ;
+
+protected:
+    std::list<AttributeHandle> _set;
 };
 
-class FederateHandleSet : public std::list<FederateHandle>
+class FederateHandleSet
 {
 public:
     FederateHandleSet(ULong size);
@@ -71,6 +73,9 @@
     virtual void empty();
 
     virtual bool isMember(FederateHandle h) const ;
+
+protected:
+    std::list<FederateHandle> _set;
 };
 
 class AttributeHandleValuePair
@@ -90,7 +95,6 @@
 };
 
 class AttributeHandleValuePairSet
-    : public std::list<AttributeHandleValuePair *>
 {
     // ATTRIBUTES
 public:
@@ -129,6 +133,9 @@
     virtual ULong start() const ;
     virtual ULong valid(ULong i) const ;
     virtual ULong next(ULong i) const ;
+
+protected:
+    std::list<AttributeHandleValuePair *> _set;
 };
 
 class ParameterHandleValuePair
@@ -143,7 +150,6 @@
 };
 
 class ParameterHandleValuePairSet
-    : public std::list<ParameterHandleValuePair *>
 {
 public:
     OrderType _order ;
@@ -183,6 +189,9 @@
     virtual ULong start() const ;
     virtual ULong valid(ULong i) const ;
     virtual ULong next(ULong i) const ;
+
+protected:
+    std::list<ParameterHandleValuePair *> _set;
 };
 
 } // namespace certi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]