00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __NEOWTKATTRIBUTE_H
00028 #define __NEOWTKATTRIBUTE_H
00029
00030
00031 #include "base.h"
00032 #include "msg.h"
00033
00034 #ifdef HAVE_NEOCHUNKIO
00035 # include <neochunkio/complex.h>
00036 # include "chunktype.h"
00037 #endif
00038
00039 #include <neoengine/hashstring.h>
00040
00041
00048 namespace NeoWTK
00049 {
00050
00051
00057 class NEOWTK_API AttributeBase
00058 {
00059 public:
00060
00062 NeoEngine::HashString m_strName;
00063
00064
00067 AttributeBase( const NeoEngine::HashString &rstrName ) : m_strName( rstrName ) {}
00068
00071 virtual ~AttributeBase() {}
00072 };
00073
00074
00080 template <class T> class Attribute : public AttributeBase
00081 {
00082 public:
00083
00085 T m_kData;
00086
00087
00088
00093 Attribute( const NeoEngine::HashString &rstrName, const T &rkData ) : AttributeBase( rstrName ), m_kData( rkData ) {}
00094
00097 virtual ~Attribute() {}
00098 };
00099
00100
00101 #ifdef HAVE_NEOCHUNKIO
00102
00103
00109 class NEOWTK_API AttributeChunk : public NeoChunkIO::ComplexChunk
00110 {
00111 public:
00112
00114 AttributeBase *m_pkData;
00115
00116
00123 AttributeChunk( unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID = "" ) : NeoChunkIO::ComplexChunk( usType, rstrType, rstrID ), m_pkData( 0 ) {}
00124
00128 virtual ~AttributeChunk();
00129
00136 virtual int ParseData( unsigned int uiFlags, NeoEngine::FileManager *pkFileManager );
00137
00145 static NeoChunkIO::Chunk *Allocator( unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID ) { return new AttributeChunk( usType, rstrType, rstrID ); }
00146 };
00147
00148
00149 #endif
00152 };
00155 #endif