35 #ifndef IE_CORE_INDEXEDIO_H
36 #define IE_CORE_INDEXEDIO_H
43 #include "OpenEXR/half.h"
45 #include "IECore/Export.h"
46 #include "IECore/RunTimeTyped.h"
47 #include "IECore/InternedString.h"
52 IE_CORE_FORWARDDECLARE( IndexedIO );
74 typedef unsigned OpenMode;
123 typedef std::vector< EntryID > EntryIDList;
126 static const EntryID rootName;
128 static const EntryIDList rootPath;
130 typedef IndexedIOPtr (*CreatorFn)(
const std::string &,
const EntryIDList &, IndexedIO::OpenMode );
140 static IndexedIOPtr create(
const std::string &path,
const EntryIDList &root, IndexedIO::OpenMode mode);
144 static void supportedExtensions( std::vector<std::string> &extensions );
152 Description(
const std::string &extension) { IndexedIO::registerCreator( extension, &T::create ); }
158 virtual IndexedIO::OpenMode openMode()
const = 0;
161 virtual void path( IndexedIO::EntryIDList & )
const = 0;
170 virtual void entryIds( IndexedIO::EntryIDList &names )
const = 0;
173 virtual void entryIds( IndexedIO::EntryIDList &names, IndexedIO::EntryType type )
const = 0;
195 virtual void removeAll() = 0;
201 virtual void commit() = 0;
204 virtual IndexedIOPtr parentDirectory() = 0;
207 virtual ConstIndexedIOPtr parentDirectory()
const = 0;
210 virtual IndexedIOPtr directory(
const IndexedIO::EntryIDList &path,
MissingBehaviour missingBehaviour = ThrowIfMissing ) = 0;
213 virtual ConstIndexedIOPtr directory(
const IndexedIO::EntryIDList &path,
MissingBehaviour missingBehaviour = ThrowIfMissing )
const = 0;
219 virtual void write(
const IndexedIO::EntryID &name,
const float *x,
unsigned long arrayLength) = 0;
225 virtual void write(
const IndexedIO::EntryID &name,
const double *x,
unsigned long arrayLength) = 0;
231 virtual void write(
const IndexedIO::EntryID &name,
const half *x,
unsigned long arrayLength) = 0;
237 virtual void write(
const IndexedIO::EntryID &name,
const int *x,
unsigned long arrayLength) = 0;
243 virtual void write(
const IndexedIO::EntryID &name,
const int64_t *x,
unsigned long arrayLength) = 0;
249 virtual void write(
const IndexedIO::EntryID &name,
const uint64_t *x,
unsigned long arrayLength) = 0;
255 virtual void write(
const IndexedIO::EntryID &name,
const unsigned int *x,
unsigned long arrayLength) = 0;
261 virtual void write(
const IndexedIO::EntryID &name,
const char *x,
unsigned long arrayLength) = 0;
267 virtual void write(
const IndexedIO::EntryID &name,
const unsigned char *x,
unsigned long arrayLength) = 0;
273 virtual void write(
const IndexedIO::EntryID &name,
const short *x,
unsigned long arrayLength) = 0;
279 virtual void write(
const IndexedIO::EntryID &name,
const unsigned short *x,
unsigned long arrayLength) = 0;
285 virtual void write(
const IndexedIO::EntryID &name,
const std::string *x,
unsigned long arrayLength) = 0;
357 virtual void read(
const IndexedIO::EntryID &name,
float *&x,
unsigned long arrayLength)
const = 0;
363 virtual void read(
const IndexedIO::EntryID &name,
double *&x,
unsigned long arrayLength)
const = 0;
369 virtual void read(
const IndexedIO::EntryID &name, half *&x,
unsigned long arrayLength)
const = 0;
375 virtual void read(
const IndexedIO::EntryID &name,
int *&x,
unsigned long arrayLength)
const = 0;
381 virtual void read(
const IndexedIO::EntryID &name, int64_t *&x,
unsigned long arrayLength)
const = 0;
387 virtual void read(
const IndexedIO::EntryID &name, uint64_t *&x,
unsigned long arrayLength)
const = 0;
393 virtual void read(
const IndexedIO::EntryID &name,
unsigned int *&x,
unsigned long arrayLength)
const = 0;
399 virtual void read(
const IndexedIO::EntryID &name,
char *&x,
unsigned long arrayLength)
const = 0;
405 virtual void read(
const IndexedIO::EntryID &name,
unsigned char *&x,
unsigned long arrayLength)
const = 0;
411 virtual void read(
const IndexedIO::EntryID &name,
short *&x,
unsigned long arrayLength)
const = 0;
417 virtual void read(
const IndexedIO::EntryID &name,
unsigned short *&x,
unsigned long arrayLength)
const = 0;
423 virtual void read(
const IndexedIO::EntryID &name, std::string *&x,
unsigned long arrayLength)
const = 0;
497 Entry(
const EntryID &
id, EntryType eType,
DataType dType,
unsigned long arrayLength);
500 const EntryID &id()
const;
503 EntryType entryType()
const;
510 bool isArray()
const;
513 unsigned long arrayLength()
const;
516 static bool isArray(
DataType dType );
521 EntryType m_entryType;
523 unsigned long m_arrayLength;
528 struct DataSizeTraits;
532 struct DataFlattenTraits;
535 struct DataTypeTraits;
545 static void validateOpenMode(IndexedIO::OpenMode &mode);
549 static void registerCreator(
const std::string &extension, CreatorFn f );
551 typedef std::map<std::string, CreatorFn> CreatorMap;
552 static CreatorMap &getCreateFns() {
static CreatorMap *g_createFns =
new CreatorMap();
return *g_createFns; }
558 #include "IndexedIO.inl"
560 #endif // IE_CORE_INDEXEDIO_H
OpenModeFlags
General enums and low level structures.
Definition: IndexedIO.h:64
Obsolete.
Definition: IndexedIO.h:94
Definition: IndexedIO.h:57
DataType
Definition: IndexedIO.h:83
Definition: IndexedIO.h:150
Obsolete.
Definition: IndexedIO.h:93
MissingBehaviour
Enum used to specify behavior when querying child directories.
Definition: IndexedIO.h:116
Definition: InternedString.h:55
A representation of a single file/directory.
Definition: IndexedIO.h:492
Definition: RunTimeTyped.h:211
This namespace contains all components of the core library.
Definition: AddSmoothSkinningInfluencesOp.h:43