Katana Plug-in APIs 0.1

FileReader.h

00001 // Copyright (c) 2014 The Foundry Visionmongers Ltd. All Rights Reserved.
00002 
00003 #ifndef FILEREADER_H
00004 #define FILEREADER_H
00005 
00006 #include <map>
00007 #include <string>
00008 
00009 // The data structure that contains the info about all the attributes and their
00010 // node names that will have to match the ones in the scene graph.
00011 // AttrDataEntries corresponds to a map of attribute name/value pairs.
00012 // AttrData's key is the name of the node to be matched and the value is an
00013 // AttrDataEntries map.
00014 typedef std::string AttrDataEntry;
00015 typedef std::map<std::string, AttrDataEntry> AttrDataEntries;
00016 typedef std::map<std::string, AttrDataEntries> AttrData;
00017 
00018 
00019 // The abstract base class for classes that are responsible for parsing a file
00020 // with attribute information and transforming it into an AttrData object.
00021 class FileReader
00022 {
00023 public:
00024     virtual ~FileReader(){}
00025     virtual AttrData read(std::string filename) = 0;
00026 };
00027 
00028 // The signature of the factory function that is resolved by the dynamic library.
00029 // The function should instantiate a FileReader on the heap. It is the user's
00030 // responsibility to delete it afterwards.
00031 typedef FileReader* createAttrFileReader_t();
00032 
00033 
00034 #endif
00035 
 All Classes Functions Variables Typedefs Enumerations Enumerator