From 663dc499a638602d1eb8d1f2a44199419c1a4ea6 Mon Sep 17 00:00:00 2001 From: Shon Ferguson <shonferg@users.sourceforge.net> Date: Sat, 19 May 2007 21:48:46 +0000 Subject: [PATCH] Moving array template to nif_basic_types so that NIF_IO won't need to be exposed. --- include/NIF_IO.h | 19 +------------------ include/nif_basic_types.h | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/include/NIF_IO.h b/include/NIF_IO.h index 83593224..887889ad 100644 --- a/include/NIF_IO.h +++ b/include/NIF_IO.h @@ -19,24 +19,7 @@ using namespace std; #define NULL 0 #endif -/*! Used to enable static arrays to be members of vectors */ -template<int size, class T> -struct array { - array() { - for ( size_t i = 0; i < size; ++i ) { - data[i] = T(); - } - } - ~array() {} - T & operator[]( unsigned int index ) { - return data[index]; - } - const T & operator[]( unsigned int index ) const { - return data[index]; - } -private: - T data[size]; -}; +#define MAXARRAYDUMP 20 //--IO Functions--// diff --git a/include/nif_basic_types.h b/include/nif_basic_types.h index 0f3f1acd..f7868966 100644 --- a/include/nif_basic_types.h +++ b/include/nif_basic_types.h @@ -61,6 +61,25 @@ struct NifInfo { string exportInfo2; }; +/*! Used to enable static arrays to be members of vectors */ +template<int size, class T> +struct array { + array() { + for ( size_t i = 0; i < size; ++i ) { + data[i] = T(); + } + } + ~array() {} + T & operator[]( unsigned int index ) { + return data[index]; + } + const T & operator[]( unsigned int index ) const { + return data[index]; + } +private: + T data[size]; +}; + //TODO: This is temporary to make it compile. Should eventually be adjusted to display 1's and 0's insted of as an int. typedef unsigned short Flags; } -- GitLab