Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
LAMBERT Jean-charles
unsio
Commits
fdec419b
Commit
fdec419b
authored
Mar 14, 2016
by
LAMBERT Jean-charles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put template instantiation after template declaration allows
older g++ compilation success
parent
07c1d664
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
107 additions
and
91 deletions
+107
-91
ChangeLog
ChangeLog
+1
-0
src/snapshotgadget.cc
src/snapshotgadget.cc
+15
-15
src/snapshotgadgeth5.cc
src/snapshotgadgeth5.cc
+15
-13
src/snapshotinterface.cc
src/snapshotinterface.cc
+18
-15
src/snapshotlist.cc
src/snapshotlist.cc
+10
-8
src/snapshotnemo.cc
src/snapshotnemo.cc
+14
-13
src/snapshotramses.cc
src/snapshotramses.cc
+9
-9
src/snapshotsim.cc
src/snapshotsim.cc
+9
-7
src/uns.cc
src/uns.cc
+16
-11
No files found.
ChangeLog
View file @
fdec419b
2.0.0 (dev)
------------
- new API for reading/writing in float and double
- gadget HDF5 support
1.1.0 (February 2015)
-----------------------
...
...
src/snapshotgadget.cc
View file @
fdec419b
...
...
@@ -26,12 +26,6 @@
namespace
uns
{
// C++11
//extern template class CSnapshotGadgetIn<float>;
template
class
CSnapshotGadgetIn
<
float
>;
//extern template class CSnapshotGadgetIn<double>;
template
class
CSnapshotGadgetIn
<
double
>;
// ----------------------------------------------------------------------------
// READING constructor
template
<
class
T
>
...
...
@@ -1473,12 +1467,7 @@ void CSnapshotGadgetIn<T>::storeComponents()
// CSnapshotGadgetOut CLASS implementation
//
// ----------------------------------------------------------------------------
// C++11
//extern template class CSnapshotGadgetOut<float>;
template
class
CSnapshotGadgetOut
<
float
>;
//extern template class CSnapshotGadgetOut<double>;
template
class
CSnapshotGadgetOut
<
double
>;
// ----------------------------------------------------------------------------
// WRITING constructor
template
<
class
T
>
...
...
@@ -2613,9 +2602,20 @@ std::vector<double> CSnapshotGadgetOut<T>::moveToCom()
return
com
;
}
// templates
//template int CSnapshotGadgetOut::writeDataValue(int value,const size_t size_bytes,const int items);
//template int CSnapshotGadgetOut::writeDataValue(float value,const size_t size_bytes,const int items);
//template int CSnapshotGadgetOut::writeDataValue(double value,const size_t size_bytes,const int items);
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Templates instantiation MUST be declared **AFTER** templates declaration
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// C++11
//extern template class CSnapshotGadgetIn<float>;
template
class
CSnapshotGadgetIn
<
float
>;
//extern template class CSnapshotGadgetIn<double>;
template
class
CSnapshotGadgetIn
<
double
>;
// C++11
//extern template class CSnapshotGadgetOut<float>;
template
class
CSnapshotGadgetOut
<
float
>;
//extern template class CSnapshotGadgetOut<double>;
template
class
CSnapshotGadgetOut
<
double
>;
}
// end of namespace
src/snapshotgadgeth5.cc
View file @
fdec419b
...
...
@@ -20,19 +20,6 @@
namespace
uns
{
// C++11
//extern template class CSnapshotGadgetH5In<float>;
template
class
CSnapshotGadgetH5In
<
float
>;
//extern template class CSnapshotGadgetH5In<double>;
template
class
CSnapshotGadgetH5In
<
double
>;
//extern template class GH5<float>;
template
class
GH5
<
float
>;
//extern template class GH5<double>;
template
class
GH5
<
double
>;
// ----------------------------------------------------------------------------
// READING constructor
template
<
class
T
>
...
...
@@ -732,6 +719,21 @@ template <class U> std::vector<U> GH5<T>::getDataset(std::string dset_name, U du
return
vret
;
}
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Templates instantiation MUST be declared **AFTER** templates declaration
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// C++11
//extern template class CSnapshotGadgetH5In<float>;
template
class
CSnapshotGadgetH5In
<
float
>;
//extern template class CSnapshotGadgetH5In<double>;
template
class
CSnapshotGadgetH5In
<
double
>;
//extern template class GH5<float>;
template
class
GH5
<
float
>;
//extern template class GH5<double>;
template
class
GH5
<
double
>;
}
// end of namespace
src/snapshotinterface.cc
View file @
fdec419b
...
...
@@ -27,20 +27,6 @@
namespace
uns
{
// C++11
//extern template class CSnapshotInterfaceIn<float>;
template
class
CSnapshotInterfaceIn
<
float
>;
//extern template class CSnapshotInterfaceIn<double>;
template
class
CSnapshotInterfaceIn
<
double
>;
// C++11
//extern template class CSnapshotInterfaceOut<float>;
template
class
CSnapshotInterfaceOut
<
float
>;
//extern template class CSnapshotInterfaceOut<double>;
template
class
CSnapshotInterfaceOut
<
double
>;
// ============================================================================
// parseConfig
template
<
class
T
>
std
::
string
CSnapshotInterfaceIn
<
T
>::
parseConfig
(
std
::
string
req
)
...
...
@@ -365,6 +351,23 @@ template <class T> bool CSnapshotInterfaceIn<T>::getRangeSelect(const char * _c
}
return
status
;
}
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Templates instantiation MUST be declared **AFTER** templates declaration
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// C++11
//extern template class CSnapshotInterfaceIn<float>;
template
class
CSnapshotInterfaceIn
<
float
>;
//extern template class CSnapshotInterfaceIn<double>;
template
class
CSnapshotInterfaceIn
<
double
>;
// C++11
//extern template class CSnapshotInterfaceOut<float>;
template
class
CSnapshotInterfaceOut
<
float
>;
//extern template class CSnapshotInterfaceOut<double>;
template
class
CSnapshotInterfaceOut
<
double
>;
}
// end of namespace uns
// ============================================================================
src/snapshotlist.cc
View file @
fdec419b
...
...
@@ -21,13 +21,6 @@
#include <iostream>
namespace
uns
{
// C++11
//extern template class CSnapshotList<float>;
template
class
CSnapshotList
<
float
>;
//extern template class CSnapshotList<double>;
template
class
CSnapshotList
<
double
>;
// ----------------------------------------------------------------------------
// constructor
...
...
@@ -177,7 +170,16 @@ template <class T> bool CSnapshotList<T>::getLine(const bool force)
else
status
=
false
;
return
status
;
}
}
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Templates instantiation MUST be declared **AFTER** templates declaration
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// C++11
//extern template class CSnapshotList<float>;
template
class
CSnapshotList
<
float
>;
//extern template class CSnapshotList<double>;
template
class
CSnapshotList
<
double
>;
}
// end of namespace
//
src/snapshotnemo.cc
View file @
fdec419b
...
...
@@ -27,11 +27,6 @@
#include "unsdebug.h"
namespace
uns
{
// C++11
//extern template class CSnapshotNemoIn<float>;
template
class
CSnapshotNemoIn
<
float
>;
//extern template class CSnapshotNemoIn<double>;
template
class
CSnapshotNemoIn
<
double
>;
// ============================================================================
// Constructor
...
...
@@ -577,16 +572,9 @@ template <class T> bool CSnapshotNemoIn<T>::getData(const std::string name, int
return
ok
;
}
// ============================================================================
//
// CSnapshotNemoOut CLASS implementation
//
// C++11
//extern template class CSnapshotNemoOut<float>;
template
class
CSnapshotNemoOut
<
float
>;
//extern template class CSnapshotNemoOut<double>;
template
class
CSnapshotNemoOut
<
double
>;
// ----------------------------------------------------------------------------
// constructor
...
...
@@ -940,7 +928,20 @@ template <class T> std::vector<double> CSnapshotNemoOut<T>::moveToCom()
}
return
com
;
}
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Templates instantiation MUST be declared **AFTER** templates declaration
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// C++11
//extern template class CSnapshotNemoIn<float>;
template
class
CSnapshotNemoIn
<
float
>;
//extern template class CSnapshotNemoIn<double>;
template
class
CSnapshotNemoIn
<
double
>;
// C++11
//extern template class CSnapshotNemoOut<float>;
template
class
CSnapshotNemoOut
<
float
>;
//extern template class CSnapshotNemoOut<double>;
template
class
CSnapshotNemoOut
<
double
>;
}
// end of uns namespace
//
src/snapshotramses.cc
View file @
fdec419b
...
...
@@ -21,12 +21,6 @@
#include "uns.h"
namespace
uns
{
// C++11
//extern template class CSnapshotRamsesIn<float>;
template
class
CSnapshotRamsesIn
<
float
>;
//extern template class CSnapshotRamsesIn<double>;
template
class
CSnapshotRamsesIn
<
double
>;
// ============================================================================
// constructor : CSnapshotRamsesIn
...
...
@@ -614,8 +608,14 @@ template <class T> bool CSnapshotRamsesIn<T>::getData(const std::string name,int
}
return
ok
;
}
// ============================================================================
// Normal function
// ============================================================================
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Templates instantiation MUST be declared **AFTER** templates declaration
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// C++11
//extern template class CSnapshotRamsesIn<float>;
template
class
CSnapshotRamsesIn
<
float
>;
//extern template class CSnapshotRamsesIn<double>;
template
class
CSnapshotRamsesIn
<
double
>;
}
// end of namespace uns
src/snapshotsim.cc
View file @
fdec419b
...
...
@@ -38,12 +38,6 @@ template <class T> std::string uns::CSnapshotInterfaceIn<T>::nemo_range_file="/
template
<
class
T
>
std
::
string
uns
::
CSnapshotInterfaceIn
<
T
>::
eps_db_file
=
"/pil/programs/DB/sim_eps.txt"
;
// SQLITE database
// C++11
//extern template class CSnapshotSimIn<float>;
template
class
CSnapshotSimIn
<
float
>;
//extern template class CSnapshotSimIn<double>;
template
class
CSnapshotSimIn
<
double
>;
// ----------------------------------------------------------------------------
// constructor
template
<
class
T
>
CSnapshotSimIn
<
T
>::
CSnapshotSimIn
(
const
std
::
string
_name
,
...
...
@@ -754,5 +748,13 @@ template <class T> int CSnapshotSimIn<T>::getCod(const std::string select,
}
return
status
;
}
}
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Templates instantiation MUST be declared **AFTER** templates declaration
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// C++11
//extern template class CSnapshotSimIn<float>;
template
class
CSnapshotSimIn
<
float
>;
//extern template class CSnapshotSimIn<double>;
template
class
CSnapshotSimIn
<
double
>;
}
// end of namespace
#endif // NOSQLITE3
src/uns.cc
View file @
fdec419b
...
...
@@ -33,12 +33,6 @@ namespace uns {
template
<
class
T
>
std
::
map
<
std
::
string
,
StringData
>
CunsOut2
<
T
>::
s_mapStringValues
;
template
<
class
T
>
std
::
map
<
std
::
string
,
int
>
CunsIn2
<
T
>::
s_mapCompInt
;
// C++11
//extern template class CunsIn2<float>;
template
class
CunsIn2
<
float
>;
//extern template class CunsIn2<double>;
template
class
CunsIn2
<
double
>;
// ----------------------------------------------------------------------------
// READING OPERATIONS
template
<
class
T
>
CunsIn2
<
T
>::
CunsIn2
(
const
std
::
string
_name
,
const
std
::
string
_comp
,
const
std
::
string
_time
,
const
bool
verb
)
...
...
@@ -271,12 +265,7 @@ template <class T> bool CunsIn2<T>::getData(const std::string prop,int * ivalue
// ----------------------------------------------------------------------------
// WRITING OPERATIONS
// ---------------------------------------------------------------------------
// C++11
//extern template class CunsOut2<float>;
template
class
CunsOut2
<
float
>;
//extern template class CunsOut2<double>;
template
class
CunsOut2
<
double
>;
// ---------------------------------------------------------------------------
// constructor
template
<
class
T
>
CunsOut2
<
T
>::
CunsOut2
(
const
std
::
string
_name
,
const
std
::
string
_type
,
const
bool
_verb
)
...
...
@@ -415,6 +404,22 @@ template <class T> void CunsOut2<T>::initializeStringMap(const bool verbose)
}
}
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Templates instantiation MUST be declared **AFTER** templates declaration
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// C++11
//extern template class CunsIn2<float>;
template
class
CunsIn2
<
float
>;
//extern template class CunsIn2<double>;
template
class
CunsIn2
<
double
>;
// C++11
//extern template class CunsOut2<float>;
template
class
CunsOut2
<
float
>;
//extern template class CunsOut2<double>;
template
class
CunsOut2
<
double
>;
}
// ----------------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment