1 /*******************************************************************/
2 /*                               XDMF                              */
3 /*                   eXtensible Data Model and Format              */
4 /*                                                                 */
5 /*  Id : Id  */
6 /*  Date : $Date$ */
7 /*  Version : $Revision$ */
8 /*                                                                 */
9 /*  Author:                                                        */
10 /*     Jerry A. Clarke                                             */
11 /*     clarke@arl.army.mil                                         */
12 /*     US Army Research Laboratory                                 */
13 /*     Aberdeen Proving Ground, MD                                 */
14 /*                                                                 */
15 /*     Copyright @ 2002 US Army Research Laboratory                */
16 /*     All Rights Reserved                                         */
17 /*     See Copyright.txt or http://www.arl.hpc.mil/ice for details */
18 /*                                                                 */
19 /*     This software is distributed WITHOUT ANY WARRANTY; without  */
20 /*     even the implied warranty of MERCHANTABILITY or FITNESS     */
21 /*     FOR A PARTICULAR PURPOSE.  See the above copyright notice   */
22 /*     for more information.                                       */
23 /*                                                                 */
24 /*******************************************************************/
25 #ifndef __XdmfLightData_h
26 #define __XdmfLightData_h
27 
28 #include "XdmfObject.h"
29 
30 #ifndef SWIG
31 #include <string.h> // strcmp, strlen, strcpy
32 #endif
33 
34 // typedef XdmfPointer XdmfXmlNode;
35 struct _xmlNode;
36 typedef _xmlNode *XdmfXmlNode;
37 struct _xmlDoc;
38 typedef _xmlDoc *XdmfXmlDoc;
39 
40 namespace xdmf2
41 {
42 
43 //! Base object for Light Data (XML)
44 /*!
45 This is an abstract convenience object for reading and writing
46 LightData Files. LightData "points" to HeavyData ; the giga-terabytes of HPC simulations.
47 
48 A XdmfLightData Object is not used by itself. Rather one of the derived
49 classes like XdmfGrid or XdmfFormatMulti is used and these derived methods
50 are used from that class.
51 */
52 
53 class XDMF_EXPORT XdmfLightData : public XdmfObject {
54 
55 public:
56   XdmfLightData();
57   ~XdmfLightData();
58 
GetClassName()59   XdmfConstString GetClassName() { return ( "XdmfLightData" ) ; };
60 
61 //! Set the current name
62     XdmfSetStringMacro(Name);
63 //! Get the current name
64     XdmfGetValueMacro(Name, XdmfConstString);
65 
66 //! Set the current filename
67     XdmfSetStringMacro(FileName);
68 //! Get the current filename
69     XdmfGetValueMacro(FileName, XdmfConstString);
70 
71 /*! Set the current WorkingDirectory
72         This alleviates the need to hard code pathnames in the
73         light data. i.e. the heavy and light data can be in
74         one directory and accessed from another.
75 */
76     XdmfSetStringMacro(WorkingDirectory);
77 //! Get the current WorkingDirectory
78     XdmfGetValueMacro(WorkingDirectory, XdmfConstString);
79 
80 //! Has Object been properly initialized
81     XdmfGetValueMacro(Initialized, XdmfInt32);
82     XdmfSetValueMacro(Initialized, XdmfInt32);
83 
84 /*! To avoid memory leaks, string return values from methods point to a static buffer.
85     If the calling function wishes to retain this value, it must be copied.
86     This method copies the value into the static return buffer, allocating space if necessary.
87         \param ReturnValue A zero terminated string
88 */
89 
90 /*! Get the char * to the string portion of the return buffer.
91 */
GetReturnBuffer()92     XdmfConstString GetReturnBuffer() {return(this->StaticReturnBuffer);};
93 
94 
95 protected:
96     XdmfConstString DupChars(XdmfPointer Chars);
97     XdmfConstString DupBuffer(XdmfPointer Buffer);
98     XdmfString      WorkingDirectory;
99     XdmfString      FileName;
100     XdmfString      Name;
101     XdmfString      StaticReturnBuffer;
102     XdmfInt32       Initialized;
103 };
104 
105 }
106 #endif // __XdmfLightData_h
107