[GME-commit] GMESRC/GME/Common CommonCollection.h,1.5,1.6 CommonStl.cpp,1.1,1.2 CommonStl.h,1.3,1.4

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Wed Oct 13 11:17:56 CDT 2004


Update of /var/lib/gme/GMESRC/GME/Common
In directory braindrain:/tmp/cvs-serv20870/Common

Modified Files:
	CommonCollection.h CommonStl.cpp CommonStl.h 
Log Message:
GME ported to STLport
-std:: prefix added to stl classes and methods



CVS User: zolmol

Index: CommonCollection.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Common/CommonCollection.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** CommonCollection.h	2 Oct 2002 18:16:00 -0000	1.5
--- CommonCollection.h	13 Oct 2004 15:17:54 -0000	1.6
***************
*** 4,8 ****
  
  #include <vector>
! #include <slist>
  
  template<class ITFTYPE, class OBJTYPE>
--- 4,8 ----
  
  #include <vector>
! #include <list>//slist
  
  template<class ITFTYPE, class OBJTYPE>
***************
*** 144,150 ****
  
  template<class ITFTYPE> 
! void push_best(slist<ITFTYPE*> &into, ITFTYPE *o) { into.push_front(o); }
  template<class ITFTYPE> 
! void push_best(vector<ITFTYPE*> &into, ITFTYPE *o) { into.push_back(o); }
  
  template<class COLLITF, class COLLTYPE, class ITFTYPE, class OBJTYPE>
--- 144,150 ----
  
  template<class ITFTYPE> 
! void push_best(std::list<ITFTYPE*> &into, ITFTYPE *o) { into.push_front(o); }//slist
  template<class ITFTYPE> 
! void push_best(std::vector<ITFTYPE*> &into, ITFTYPE *o) { into.push_back(o); }
  
  template<class COLLITF, class COLLTYPE, class ITFTYPE, class OBJTYPE>
***************
*** 305,309 ****
  
  template<class COLLITF, class ITFTYPE>
! void GetAll(COLLITF *coll, vector< CComObjPtr<ITFTYPE> > &ret)
  {
  	ASSERT( coll != NULL );
--- 305,309 ----
  
  template<class COLLITF, class ITFTYPE>
! void GetAll(COLLITF *coll, std::vector< CComObjPtr<ITFTYPE> > &ret)
  {
  	ASSERT( coll != NULL );
***************
*** 320,324 ****
  }
  
! inline HRESULT check_location_compatibility(IUnknown *newobj, IUnknown *oldobj) { return S_OK; }
  
  
--- 320,324 ----
  }
  
! inline HRESULT check_location_compatibility(IUnknown *, IUnknown *) { return S_OK; }
  
  

Index: CommonStl.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Common/CommonStl.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CommonStl.cpp	5 Jul 2000 20:12:00 -0000	1.1
--- CommonStl.cpp	13 Oct 2004 15:17:54 -0000	1.2
***************
*** 6,10 ****
  // --------------------------- string
  
! void vFormat(string &s, const char *format, va_list args)
  {
  	const int maxsize = 1024;
--- 6,10 ----
  // --------------------------- string
  
! void vFormat(std::string &s, const char *format, va_list args)
  {
  	const int maxsize = 1024;

Index: CommonStl.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Common/CommonStl.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CommonStl.h	2 Oct 2002 18:16:00 -0000	1.3
--- CommonStl.h	13 Oct 2004 15:17:54 -0000	1.4
***************
*** 16,25 ****
  // these THROW exceptions
  
! inline void CopyTo(const string &s, BSTR *b) { CopyTo(s.begin(), s.length(), b); }
! inline void CopyTo(const string &s, VARIANT *v) { CopyTo(s.begin(), s.length(), v); }
! inline void CopyTo(const string &s, CComBstrObj &a) { CopyTo(s.begin(), s.length(), a); }
! inline void CopyTo(const string &s, CComVariant &a) { CopyTo(s.begin(), s.length(), a); }
  
! inline void CopyTo(BSTR b, string &s)
  {
  	s.resize(GetCharLength(b));
--- 16,25 ----
  // these THROW exceptions
  
! inline void CopyTo(const std::string &s, BSTR *b) { CopyTo(s.begin(), s.length(), b); }
! inline void CopyTo(const std::string &s, VARIANT *v) { CopyTo(s.begin(), s.length(), v); }
! inline void CopyTo(const std::string &s, CComBstrObj &a) { CopyTo(s.begin(), s.length(), a); }
! inline void CopyTo(const std::string &s, CComVariant &a) { CopyTo(s.begin(), s.length(), a); }
  
! inline void CopyTo(BSTR b, std::string &s)
  {
  	s.resize(GetCharLength(b));
***************
*** 27,31 ****
  }
  
! inline void CopyTo(VARIANT &v, string &s)
  {
  	s.resize(GetCharLength(v));
--- 27,31 ----
  }
  
! inline void CopyTo(VARIANT &v, std::string &s)
  {
  	s.resize(GetCharLength(v));
***************
*** 33,39 ****
  }
  
! void vFormat(string &s, const char *format, va_list args);
  
! inline void Format(string &s, const char *format, ...)
  {
  	va_list args;
--- 33,39 ----
  }
  
! void vFormat(std::string &s, const char *format, va_list args);
  
! inline void Format(std::string &s, const char *format, ...)
  {
  	va_list args;
***************
*** 43,48 ****
  }
  
! typedef vector<wchar_t>::iterator bstr_iterator;
! typedef vector<wchar_t>::const_iterator bstr_const_iterator;
  
  inline bstr_const_iterator begin(BSTR p) { return p; }
--- 43,48 ----
  }
  
! typedef std::vector<wchar_t>::iterator bstr_iterator;
! typedef std::vector<wchar_t>::const_iterator bstr_const_iterator;
  
  inline bstr_const_iterator begin(BSTR p) { return p; }
***************
*** 57,61 ****
  // --------------------------- bindata
  
! typedef vector<unsigned char> bindata;
  
  inline void CopyTo(const bindata &b, VARIANT *p) { CopyTo(b.begin(), b.end(), p); }
--- 57,61 ----
  // --------------------------- bindata
  
! typedef std::vector<unsigned char> bindata;
  
  inline void CopyTo(const bindata &b, VARIANT *p) { CopyTo(b.begin(), b.end(), p); }
***************
*** 76,80 ****
  }
  
! inline void MoveTo(SAFEARRAY *p, vector<CComBstrObj> &bstrobjs)
  {
  	ASSERT( p != NULL );
--- 76,80 ----
  }
  
! inline void MoveTo(SAFEARRAY *p, std::vector<CComBstrObj> &bstrobjs)
  {
  	ASSERT( p != NULL );
***************
*** 84,88 ****
  }
  
! inline void MoveTo(vector<CComBstrObj> &bstrobjs, SAFEARRAY **p)
  {
  	ASSERT( p != NULL && *p == NULL );
--- 84,88 ----
  }
  
! inline void MoveTo(std::vector<CComBstrObj> &bstrobjs, SAFEARRAY **p)
  {
  	ASSERT( p != NULL && *p == NULL );
***************
*** 91,95 ****
  }
  
! inline void CopyTo(const vector<CComBstrObj> &bstrobjs, SAFEARRAY **p)
  {
  	ASSERT( p != NULL && *p == NULL );
--- 91,95 ----
  }
  
! inline void CopyTo(const std::vector<CComBstrObj> &bstrobjs, SAFEARRAY **p)
  {
  	ASSERT( p != NULL && *p == NULL );
***************
*** 98,102 ****
  }
  
! inline void CopyTo(const vector<GUID> &guids, SAFEARRAY **p)
  {
  	ASSERT( p != NULL && *p == NULL );
--- 98,102 ----
  }
  
! inline void CopyTo(const std::vector<GUID> &guids, SAFEARRAY **p)
  {
  	ASSERT( p != NULL && *p == NULL );
***************
*** 158,162 ****
  		++i;
  
! 	ASSERT( (container.size() < limit ? container.size() : limit) == (limit - counter) );
  	return limit - counter;
  }
--- 158,162 ----
  		++i;
  
! 	ASSERT( ( (int) container.size() < limit ? (int) container.size() : limit) == (limit - counter) );//zolmol!
  	return limit - counter;
  }
***************
*** 165,174 ****
  
  template<class INTERFACE>
! class CComObjPtrVector : public vector< CComObjPtr<INTERFACE> >
  {
  };
  
  template<class ELEM>
! void CopyTo(TYPENAME_ELEM2COLL(ELEM) *p, vector< CComObjPtr<ELEM> > &q)
  {
  	ASSERT( p != NULL );
--- 165,174 ----
  
  template<class INTERFACE>
! class CComObjPtrVector : public std::vector< CComObjPtr<INTERFACE> >
  {
  };
  
  template<class ELEM>
! void CopyTo(TYPENAME_ELEM2COLL(ELEM) *p, std::vector< CComObjPtr<ELEM> > &q)
  {
  	ASSERT( p != NULL );
***************
*** 193,197 ****
  	typedef TYPENAME_ELEM2COLL(ELEM) coll_interface;
  
! 	typedef vector< CComObjPtr<elem_interface> > vector_type;
  
  	operator coll_interface** () { return PutOut(coll_ptr); }
--- 193,197 ----
  	typedef TYPENAME_ELEM2COLL(ELEM) coll_interface;
  
! 	typedef std::vector< CComObjPtr<elem_interface> > vector_type;
  
  	operator coll_interface** () { return PutOut(coll_ptr); }
***************
*** 209,213 ****
  	PutOutCollObj(vector_type &v) : coll_vector(v) { }
  
! 	friend PutOutCollObj<ELEM> PutOut(vector< CComObjPtr<ELEM> > &coll_vector);
  
  	// to prevent misuse
--- 209,213 ----
  	PutOutCollObj(vector_type &v) : coll_vector(v) { }
  
! 	friend PutOutCollObj<ELEM> PutOut(std::vector< CComObjPtr<ELEM> > &coll_vector);
  
  	// to prevent misuse
***************
*** 221,225 ****
  
  template<class ELEM>
! PutOutCollObj<ELEM> PutOut(vector< CComObjPtr<ELEM> > &coll_vector)
  {
  	return PutOutCollObj<ELEM>(coll_vector);
--- 221,225 ----
  
  template<class ELEM>
! PutOutCollObj<ELEM> PutOut(std::vector< CComObjPtr<ELEM> > &coll_vector)
  {
  	return PutOutCollObj<ELEM>(coll_vector);



More information about the GME-commit mailing list