Import Geant4 10.3.1 source tree

This commit is contained in:
Gabriele Cosmo
2017-02-28 16:16:20 +01:00
parent a3452e42ac
commit 4597adb7c4
267 changed files with 14761 additions and 24650 deletions
+6
View File
@@ -17,6 +17,12 @@ committal in the SVN repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
December 19, 2016 G.Cosmo (global-V10-02-34)
- Removed obsolete utility class G4SubString used internally in G4String,
as no longer necessary and also including unnecessary and buggy operators.
Addressing problem report #1864.
- Updated date and version for 10.3.p01.
November 16, 2016 G.Cosmo (global-V10-02-33)
- Fixed compilation warning on MacOS Sierra in MT mode in function
G4Threading::G4GetPidId().
+3 -48
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4String.hh 94844 2015-12-10 16:23:09Z gcosmo $
// $Id: G4String.hh 102537 2017-02-08 14:02:58Z gcosmo $
//
//
//---------------------------------------------------------------
@@ -55,50 +55,7 @@
#endif
typedef std::string::size_type str_size;
class G4String;
class G4SubString
{
public:
inline G4SubString(const G4SubString&);
inline G4SubString& operator=(const char*);
inline G4SubString& operator=(const G4SubString&);
inline char& operator()(str_size);
inline char operator()(str_size) const;
inline char& operator[](str_size);
inline char operator[](str_size) const;
inline G4int operator!() const;
inline G4bool operator==(const G4String&) const;
inline G4bool operator==(const char*) const;
inline G4bool operator!=(const G4String&) const;
inline G4bool operator!=(const char*) const;
inline str_size length() const;
inline str_size start() const;
// For detecting null substrings
//
inline G4bool isNull() const;
private:
inline G4SubString(G4String&, str_size, str_size);
G4String* mystring;
str_size mystart;
str_size extent;
friend class G4String;
};
typedef std::string G4SubString;
class G4String : public std::string
{
@@ -115,7 +72,6 @@ public:
inline G4String ( const char * );
inline G4String ( const char *, str_size );
inline G4String ( const G4String& );
inline G4String ( const G4SubString& );
inline G4String ( const std::string & );
~G4String () {}
@@ -126,7 +82,6 @@ public:
inline char operator () (str_size) const;
inline char& operator () (str_size);
inline G4String& operator+=(const G4SubString&);
inline G4String& operator+=(const char*);
inline G4String& operator+=(const std::string &);
inline G4String& operator+=(const char&);
@@ -136,7 +91,7 @@ public:
inline G4bool operator!=(const char*) const;
inline operator const char*() const;
inline G4SubString operator()(str_size, str_size);
inline G4String operator()(str_size, str_size);
inline G4int compareTo(const char*, caseCompare mode=exact) const;
inline G4int compareTo(const G4String&, caseCompare mode=exact) const;
+3 -105
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4String.icc 94844 2015-12-10 16:23:09Z gcosmo $
// $Id: G4String.icc 102536 2017-02-08 13:53:34Z gcosmo $
//
//
//---------------------------------------------------------------
@@ -33,98 +33,6 @@
// G4String
//---------------------------------------------------------------
// **************************************************************
// G4SubString
// **************************************************************
inline G4SubString::G4SubString(const G4SubString& str)
: mystring(str.mystring), mystart(str.mystart), extent(str.extent)
{
}
inline G4SubString::G4SubString(G4String& str, str_size siz, str_size e)
: mystring(&str),mystart(siz),extent(e)
{
}
inline G4SubString& G4SubString::operator=(const G4SubString& str)
{
mystring->replace(mystart,extent,str.mystring->data(),str.length());
extent=str.length();
return *this;
}
inline G4SubString& G4SubString::operator=(const char* str)
{
mystring->replace(mystart,extent,str,strlen(str));
extent=strlen(str);
return *this;
}
inline char& G4SubString::operator()(str_size i)
{
return mystring->operator[](mystart+i);
}
inline char G4SubString::operator()(str_size i) const
{
return mystring->operator[](mystart+i);
}
inline char& G4SubString::operator[](str_size i)
{
return mystring->operator[](mystart+i);
}
inline char G4SubString::operator[](str_size i) const
{
return mystring->operator[](mystart+i);
}
inline G4int G4SubString::operator!() const
{
return (extent==0) ? 1 : 0;
}
inline G4bool G4SubString::operator==(const G4String& str) const
{
return (mystring->find(str,mystart,extent) != std::string::npos);
}
inline G4bool G4SubString::operator==(const char* str) const
{
return (mystring->find(str,mystart,extent) != std::string::npos);
}
inline G4bool G4SubString::operator!=(const G4String& str) const
{
return (mystring->find(str,mystart,extent) == std::string::npos);
}
inline G4bool G4SubString::operator!=(const char* str) const
{
return (mystring->find(str,mystart,extent) == std::string::npos);
}
inline str_size G4SubString::length() const
{
return extent;
}
inline str_size G4SubString::start() const
{
return mystart;
}
inline G4bool G4SubString::isNull() const
{
return (extent==0);
}
// **************************************************************
// G4String
// **************************************************************
inline G4String::G4String () {}
inline G4String::G4String ( const char * astring )
@@ -144,9 +52,6 @@ inline G4String::G4String ( char ch )
inline G4String::G4String ( const G4String& str )
: std_string(str) {}
inline G4String::G4String ( const G4SubString& str )
: std_string(*(str.mystring),str.mystart,str.extent) {}
inline G4String::G4String ( const std::string& str )
: std_string(str) {}
@@ -184,11 +89,9 @@ inline char& G4String::operator () (str_size i)
return std_string::operator[](i);
}
inline G4String& G4String::operator+=(const G4SubString& str)
inline G4String G4String::operator()(str_size start, str_size extent)
{
G4String tmp(str);
std_string::operator+=(tmp);
return *this;
return G4String(substr(start,extent));
}
inline G4String& G4String::operator+=(const char* str)
@@ -418,11 +321,6 @@ inline str_size G4String::index (char ch, G4int pos) const
return std_string::find(ch,pos);
}
inline G4SubString G4String::operator()(str_size start, str_size extent)
{
return G4SubString(*this,start,extent);
}
inline const char* G4String::data() const
{
return c_str();
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Tokenizer.hh 67970 2013-03-13 10:10:06Z gcosmo $
// $Id: G4Tokenizer.hh 102536 2017-02-08 13:53:34Z gcosmo $
//
//
//---------------------------------------------------------------
@@ -50,7 +50,7 @@ class G4Tokenizer
public:
G4Tokenizer(const G4String& stn):string2tokenize(stn),actual(0){}
G4SubString operator()(const char* str=" \t\n",size_t l=0)
G4String operator()(const char* str=" \t\n",size_t l=0)
{
size_t i,j,tmp;
G4bool hasws=false;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Version.hh 101827 2016-12-01 10:16:01Z gcosmo $
// $Id: G4Version.hh 102536 2017-02-08 13:53:34Z gcosmo $
// GEANT4 tag $Name:$
//
// Version information
@@ -46,11 +46,11 @@
// |--> patch number
#ifndef G4VERSION_NUMBER
#define G4VERSION_NUMBER 1030
#define G4VERSION_NUMBER 1031
#endif
#ifndef G4VERSION_TAG
#define G4VERSION_TAG "$Name: geant4-10-03 $"
#define G4VERSION_TAG "$Name: geant4-10-03-patch-01 $"
#endif
// as variables
@@ -58,10 +58,10 @@
#include "G4String.hh"
#ifdef G4MULTITHREADED
static const G4String G4Version = "$Name: geant4-10-03 [MT]$";
static const G4String G4Version = "$Name: geant4-10-03-patch-01 [MT]$";
#else
static const G4String G4Version = "$Name: geant4-10-03 $";
static const G4String G4Version = "$Name: geant4-10-03-patch-01 $";
#endif
static const G4String G4Date = "(9-December-2016)";
static const G4String G4Date = "(24-February-2017)";
#endif