mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-26 21:00:34 +05:00
archive array-functions
This commit is contained in:
parent
abaad215ce
commit
631b519676
@ -1,6 +1,8 @@
|
||||
#ifndef NGS_ARCHIVE_BASE
|
||||
#define NGS_ARCHIVE_BASE
|
||||
|
||||
// copied from netgen
|
||||
|
||||
namespace ngstd
|
||||
{
|
||||
|
||||
@ -20,6 +22,37 @@ namespace ngstd
|
||||
virtual Archive & operator & (string & str) = 0;
|
||||
virtual Archive & operator & (char *& str) = 0;
|
||||
|
||||
template <typename T>
|
||||
Archive & Do (T * data, size_t n)
|
||||
{ for (size_t j = 0; j < n; j++) { (*this) & data[j]; }; return *this; };
|
||||
|
||||
|
||||
virtual Archive & Do (double * d, size_t n)
|
||||
{ for (size_t j = 0; j < n; j++) { (*this) & d[j]; }; return *this; };
|
||||
|
||||
virtual Archive & Do (int * i, size_t n)
|
||||
{ for (size_t j = 0; j < n; j++) { (*this) & i[j]; }; return *this; };
|
||||
|
||||
virtual Archive & Do (long * i, size_t n)
|
||||
{ for (size_t j = 0; j < n; j++) { (*this) & i[j]; }; return *this; };
|
||||
|
||||
virtual Archive & Do (size_t * i, size_t n)
|
||||
{ for (size_t j = 0; j < n; j++) { (*this) & i[j]; }; return *this; };
|
||||
|
||||
virtual Archive & Do (short * i, size_t n)
|
||||
{ for (size_t j = 0; j < n; j++) { (*this) & i[j]; }; return *this; };
|
||||
|
||||
virtual Archive & Do (unsigned char * i, size_t n)
|
||||
{ for (size_t j = 0; j < n; j++) { (*this) & i[j]; }; return *this; };
|
||||
|
||||
virtual Archive & Do (bool * b, size_t n)
|
||||
{ for (size_t j = 0; j < n; j++) { (*this) & b[j]; }; return *this; };
|
||||
|
||||
|
||||
// nvirtual Archive & Do (string * str, size_t n)
|
||||
// { for (size_t j = 0; j < n; j++) { (*this) & str[j]; }; return *this; };
|
||||
// virtual Archive & operator & (char *& str) = 0;
|
||||
|
||||
template <typename T>
|
||||
Archive & operator << (const T & t)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user