Skip to content
Snippets Groups Projects
Commit 663dc499 authored by Shon Ferguson's avatar Shon Ferguson
Browse files

Moving array template to nif_basic_types so that NIF_IO won't need to be exposed.

parent 25189fa9
No related branches found
No related tags found
No related merge requests found
...@@ -19,24 +19,7 @@ using namespace std; ...@@ -19,24 +19,7 @@ using namespace std;
#define NULL 0 #define NULL 0
#endif #endif
/*! Used to enable static arrays to be members of vectors */ #define MAXARRAYDUMP 20
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];
};
//--IO Functions--// //--IO Functions--//
......
...@@ -61,6 +61,25 @@ struct NifInfo { ...@@ -61,6 +61,25 @@ struct NifInfo {
string exportInfo2; 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. //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; typedef unsigned short Flags;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment