object.h

Go to the documentation of this file.
00001 /**
00002  * \file rvc/object.h 
00003  * \brief Interface for the RVCOBJECT class.
00004  *
00005  * \if NODOC
00006  * $Id: object.h_v 1.84 2004/09/01 22:16:07 scowan Exp $
00007  *
00008  * $Log: object.h_v $
00009  * Revision 1.84  2004/09/01 22:16:07  scowan
00010  * Added copy to edit format flag.
00011  *
00012  * Revision 1.83  2004/05/14 17:15:39  scowan
00013  * Added method to get invalid children.
00014  *
00015  * Revision 1.82  2004/05/03 19:26:59  scowan
00016  * Added class to inform copy of name change.
00017  *
00018  * Revision 1.81  2004/03/23 23:03:24  scowan
00019  * Added child observer support.
00020  *
00021  * Revision 1.80  2004/03/19 18:48:06  scowan
00022  * Added more things to observe.
00023  *
00024  * Revision 1.79  2003/12/18 14:24:14  mju
00025  * Remove deprecated filter typedefs.
00026  *
00027  * Revision 1.78  2003/12/03 23:31:02  scowan
00028  * Added new set make object method.
00029  *
00030  * Revision 1.77  2003/11/25 18:42:41  scowan
00031  * Added get child list method.
00032  *
00033  * Revision 1.76  2003/11/21 23:10:03  scowan
00034  * Added new copy flag.
00035  *
00036  * Revision 1.75  2003/11/19 22:35:13  scowan
00037  * Added more open flags.
00038  *
00039  * Revision 1.74  2003/11/19 20:14:37  scowan
00040  * Added new copy flag.
00041  *
00042  * Revision 1.73  2003/11/04 22:29:27  scowan
00043  * Added copy flag and make link method.
00044  *
00045  * Revision 1.72  2003/10/30 18:27:47  scowan
00046  * Added is older than method.
00047  *
00048  * Revision 1.71  2003/10/08 22:30:22  scowan
00049  * Added method for object info dump.
00050  *
00051  * Revision 1.70  2003/10/07 17:32:18  scowan
00052  * Object virtual method changes.
00053  *
00054  * Revision 1.69  2003/10/02 19:02:19  scowan
00055  * Added another statis method.
00056  *
00057  * Revision 1.68  2003/09/30 16:52:06  dwilliss
00058  * Doxygen
00059  *
00060  * Revision 1.67  2003/09/25 21:56:58  dwilliss
00061  * doxygen
00062  *
00063  * Revision 1.66  2003/09/22 19:55:29  scowan
00064  * Added recover project file call.
00065  *
00066  * Revision 1.65  2003/09/19 22:27:03  scowan
00067  * Moved get name and get desc to virtual methods.
00068  *
00069  * Revision 1.64  2003/09/15 23:13:31  scowan
00070  * Added yet another fine method.
00071  *
00072  * Revision 1.63  2003/09/15 13:49:45  fileserver!dwilliss
00073  * Doxygen
00074  *
00075  * Revision 1.62  2003/09/08 15:30:59  scowan
00076  * Added multiple is... methods.
00077  *
00078  * Revision 1.61  2003/08/28 15:25:24  scowan
00079  * Added methods to determine and get linked file paths.
00080  *
00081  * Revision 1.60  2003/08/27 21:26:54  scowan
00082  * Support new copy object methods.
00083  *
00084  * Revision 1.59  2003/06/05 15:19:44  scowan
00085  * Changed filter name for newer than parent.
00086  *
00087  * Revision 1.58  2003/05/06 23:07:44  scowan
00088  * Added no_ deprecated around old typedef.
00089  *
00090  * Revision 1.57  2003/05/06 23:05:04  scowan
00091  * Added Mike's suggested changes.
00092  *
00093  * Revision 1.56  2003/04/09 22:03:48  scowan
00094  * Added protected method to get the file handle.
00095  *
00096  * Revision 1.55  2003/03/19 23:07:00  scowan
00097  * Forgot to inherit.
00098  *
00099  * Revision 1.54  2003/03/19 23:00:05  scowan
00100  * Added unique child name filter.
00101  *
00102  * Revision 1.53  2003/03/14 21:30:17  scowan
00103  * Added compute free file space method.
00104  *
00105  * Revision 1.52  2003/03/06 23:12:47  scowan
00106  * Added methods to flush and change temp file modes.
00107  *
00108  * Revision 1.51  2002/11/25 15:18:39  scowan
00109  * Added new change source method.
00110  *
00111  * Revision 1.50  2002/11/19 22:13:46  scowan
00112  * In newer than parent, assume equal is newer.
00113  *
00114  * Revision 1.49  2002/10/25 20:34:08  scowan
00115  * nc.
00116  *
00117  * Revision 1.48  2002/09/10 15:06:43  scowan
00118  * Added docs for Open .
00119  *
00120  * Revision 1.47  2002/08/27 20:53:43  scowan
00121  * Additional docs.
00122  *
00123  * Revision 1.46  2002/08/05 17:31:20  scowan
00124  * Doc changes.
00125  *
00126  * Revision 1.45  2002/06/12 22:12:06  scowan
00127  * Added more comments.
00128  *
00129  * Revision 1.44  2002/06/07 16:56:44  scowan
00130  * Added update time last used method.
00131  *
00132  * Revision 1.43  2002/05/23 23:07:46  scowan
00133  * Added traverse method.
00134  *
00135  * Revision 1.42  2002/04/30 20:49:30  scowan
00136  * Uses new file handle class
00137  *
00138  * Revision 1.34  2002/01/14 15:56:04  scowan
00139  * *** empty log message ***
00140  *
00141  * Revision 1.33  2002/01/14 15:49:25  scowan
00142  * Forgot one filehandle to comment out.
00143  *
00144  * Revision 1.32  2002/01/09 22:47:39  scowan
00145  * Removed const from filter calls.
00146  *
00147  * Revision 1.31  2001/09/28 15:45:10  scowan
00148  * Added protected method.
00149  *
00150  * Revision 1.30  2001/09/19 20:39:08  scowan
00151  * Moved iterator copy constructor to rvcobjct.c.
00152  *
00153  * Revision 1.29  2001/09/17 14:04:08  scowan
00154  * Added static methods.
00155  *
00156  * Revision 1.28  2001/09/07 22:00:37  scowan
00157  * Added on close observer method.
00158  *
00159  * Revision 1.27  2001/09/06 19:31:36  scowan
00160  * Comment int attach method
00161  *
00162  * Revision 1.26  2001/08/31 15:14:54  scowan
00163  * Removed deprecated tags from methods to better incorporate wrapper classes.
00164  *
00165  * Revision 1.25  2001/07/26 16:43:26  scowan
00166  * Added new get object count method.
00167  *
00168  * Revision 1.24  2001/07/25 15:16:55  scowan
00169  * Added new openmode flag.
00170  *
00171  * Revision 1.23  2001/07/12 22:15:18  scowan
00172  * Added class to temp open file if needed.
00173  *
00174  * Revision 1.22  2001/06/25 20:48:07  scowan
00175  * Added new virtual method.
00176  *
00177  * Revision 1.21  2001/06/18 14:55:03  scowan
00178  * Added protected method.
00179  *
00180  * Revision 1.20  2001/06/14 16:01:45  scowan
00181  * Changed source parameter to pass in.
00182  *
00183  * Revision 1.19  2001/06/13 21:24:20  scowan
00184  * Added rvc to method parameters.
00185  *
00186  * Revision 1.18  2001/06/13 17:07:44  scowan
00187  * Moved to RVC namespace.
00188  * Created OBJTYPESETFILTER class.
00189  *
00190  * Revision 1.17  2001/06/13 14:39:52  scowan
00191  * Remove default inode number from deprecated mathod, causing ambiguity.
00192  *
00193  * Revision 1.16  2001/06/13 14:21:09  scowan
00194  * Moved object type enum to its own include file.
00195  *
00196  * Revision 1.14  2001/05/30 16:34:18  scowan
00197  * Added get object item method.
00198  *
00199  * Revision 1.13  2001/05/23 21:59:53  scowan
00200  * Added observers and Make Link method.
00201  *
00202  * Revision 1.12  2001/01/26 14:59:44  mju
00203  * Add default of OPENMODE_Read for all object Open() methods.
00204  *
00205  * Revision 1.11  2001/01/16 17:45:36  scowan
00206  * Deprecated more code.
00207  *
00208  * Revision 1.10  2001/01/16 17:03:11  scowan
00209  * Added low loevel inode retrieval system.
00210  *
00211  * Revision 1.9  2000/12/01 17:45:00  scowan
00212  * Changed name of object type.
00213  *
00214  * Revision 1.8  2000/11/28 17:41:30  scowan
00215  * Changed name of qtree object type.
00216  *
00217  * Revision 1.7  2000/11/24 21:08:45  scowan
00218  * Added update file method.
00219  *
00220  * Revision 1.5  2000/11/06 20:08:22  scowan
00221  * Changed return types of filter fiunctions.
00222  *
00223  * Revision 1.4  2000/10/19 19:08:49  fileserver!dwilliss
00224  * Can't leave dangling comma on last item of an enum
00225  *
00226  * Revision 1.3  2000/10/19 17:44:23  scowan
00227  * Checked in for vacation.
00228  *
00229  * Revision 1.2  2000/09/29 21:41:09  scowan
00230  * Added is child of method.
00231  *
00232  * Revision 1.1  2000/09/28 22:24:17  scowan
00233  * Initial revision
00234  *
00235  * \endif
00236 **/
00237 
00238 //!   \class RVC::OBJECT rvc/object.h
00239 //!   \brief The base class for all RVC objects
00240 //!
00241 //!   <b> Defined contract of the RVC Object API system.</b>
00242 //!   
00243 //!   The RVC Object API is designed with multiple goals, the goals are defined below
00244 //!   
00245 //!   -#  Support for thread safe use of RVC objects.  This goal is met using these conditions:
00246 //!         -  RVC Object classes do not allow direct access to information that was previously in rvc object header information.  Since data
00247 //!            can change in a multi-threaded environment, methods are used to gain information.  The removal of access to rvc object headers
00248 //!            causes some desirable design changes including:
00249 //!            -# A base level open method for rvc objects that support an open paradigm.  All open functions previously took a header pointer 
00250 //!               thereby requiring a different open function for each rvc object.  This has been rendered moot.
00251 //!            -# A base level close method for most rvc objects.  All close functions took an optional header pointer thereby requiring a
00252 //!               different close function for each open rvc object type.
00253 //!         -  Read/Write access must be explicitly defined when opening an rvc object.  This allows a multi-threaded implementation to
00254 //!            generate 'locks' on rvc objects based on the access requirement.
00255 //!         -  Each instance of a rvc object gets a unique handle to the rvc object that the class represents.  Handle management is class based.
00256 //!   -# Strict hierarchy level of classes to limit errors.  This goal is met using these conditions:
00257 //!      -  RVC Object classes determine what rvc object types they can deal with.  API's cannot be mixed with this check.
00258 //!      -  Class hierarchies with base classes that support common functionality.
00259 //!   -# Eliminating the use of RVCINODENUM's to manage RVC objects.
00260 //!      -  RVCINODENUM's are not type safe and can be intermixed between open rvc objects, causing errors.
00261 //!      -  The tendancy of programmers to store RVCINODENUM's in reference files is to be RETIRED.  Hiding RVCINODENUM's from 
00262 //!            code will prevent this action.
00263 //!   
00264 //!   <b>Attaching and opening rvc objects.</b>
00265 //!   
00266 //!   The construct of attachment and opening comes from the fact that we do not handle exceptions.  Therefore error handling is done
00267 //!   through return values.  Since constructors do not have return values, the constructor set is kept to a minimum.  In addition, 
00268 //!   the concept of closing an rvc object while maintaining knowledge of where the rvc object is needs to be implemented.  Therefore two
00269 //!   methodologies have been introduced to deal with the requirements:
00270 //!
00271 //!   
00272 //!      -# The concept of attaching the instance to an rvc object using Attach() methods.  These methods will validate the attachment
00273 //!         by opening the file and locating the rvc object and validate that the derived class is appropriate for the rvc object.  The method
00274 //!         will close the file after it has accomplished its goal.
00275 //!
00276 //!      -# Opening the rvc object will perform the same checks as the Attach() method as well as keeping the file open and if possible,
00277 //!         opening the derived class rvc object.
00278 //!
00279 //!   
00280 //!   <b>Use of the 'const' keyword</b>
00281 //!   
00282 //!   The 'const' keyword is used to define methods that do not modify the rvc object.  "Const" methods for RVC::OBJECT will open the object using
00283 //! RVC::OBJECT::OPENMODE_Read and perform the operation.  Attempting to use a non-open RVC::OBJECT instance for non-const methods will result
00284 //! in the method returning an R_WriteInvalid error.
00285 
00286 
00287 #ifndef INC_RVC_OBJECT_H
00288 #define INC_RVC_OBJECT_H
00289 
00290 #ifndef INC_MI32_STDDEFNS_H
00291    #include <mi32/stddefns.h>
00292 #endif
00293 
00294 #ifndef INC_RVC_OBJTYPE_H
00295    #include <rvc/objtype.h>
00296 #endif
00297 
00298 #ifndef  INC_RVC_OTYPESET_H
00299    #include <rvc/otypeset.h>
00300 #endif
00301 
00302 #ifndef INC_MI32_RVCDEFNS_H
00303    #include <mi32/rvcdefns.h>
00304 #endif
00305 
00306 #ifndef INC_MI32_FILEPATH_H
00307    #include <mi32/filepath.h>
00308 #endif
00309 
00310 #ifndef INC_MI32_DATETIME_H
00311    #include <mi32/datetime.h>
00312 #endif
00313 
00314 #ifndef  INC_MI32_OBSERVER_H
00315    #include <mi32/observer.h>
00316 #endif
00317 
00318 #ifndef GENERATING_DOXYGEN_OUTPUT
00319 enum BYTESWAP {
00320    BYTESWAP_LoHi,
00321    BYTESWAP_HiLo
00322    };
00323 class MISTRING;
00324 #endif // GENERATING_DOXYGEN_OUTPUT
00325 
00326 namespace RVC {
00327 
00328 #ifndef GENERATING_DOXYGEN_OUTPUT
00329 class FILEHANDLE;
00330 class OBJECTOBSERVER;
00331 #endif // GENERATING_DOXYGEN_OUTPUT
00332    
00333 class OBJECT : public SUBJECT<OBJECTOBSERVER> {
00334    public:
00335 
00336       enum COPYFLAGS {
00337          COPYFLAG_None =                  0x00000000,       //!< Default, copy subobjects and links
00338          COPYFLAG_DontCopyChildren =      0x00000001,       //!< Do not copy child objects
00339          COPYFLAG_CopySpatialFromLink =   0x00000002,       //!< Copy data from spatial link, not the link itself
00340          COPYFLAG_CopyDBTableFromLink =   0x00000004,       //!< Copy data from DB table link, not the link itself
00341          COPYFLAG_CopyRVCObjectFromLink = 0x00000008,       //!< Copy data from RVC object link, not the link itself
00342          COPYFLAG_CopyTextFromLink =      0x00000010,       //!< Copy data from text link, not the link itself
00343          COPYFLAG_DontCopyStdAttTables =  0x00000020,       //!< Do not copy standard attrib tables
00344          COPYFLAG_ReportInvalidParent  =  0x00000040,       //!< Report invalid parent errors
00345          COPYFLAG_ForceOneObjectCopy   =  0x00000080,       //!< Force the copy of the most recently used object if the singleton rule is violated
00346          COPYFLAG_CopyIfNotModifiable  =  0x00000100,       //!< Copy data from the link, not the link itself, if the data is not modifiable through the link
00347          COPYFLAG_CopyToEditFormat     =  0x00000200        //!< Copy data from the source to an editable format, used for CAD currently
00348          };
00349          
00350       enum DUMPINFOFLAGS {
00351          DUMPINFOFLAG_Minimal =           0x00000000,       // Default, dumps only minimal information
00352          DUMPINFOFLAG_Subobjects =        0x00000001,       // Dump sub-object information at the end of the log
00353          DUMPINFOFLAG_FullHeader =        0x00000002,       // Dump full header information into the log
00354          DUMPINFOFLAG_ObjectData =        0x00000004,       // Dump object data information into the log
00355          // Combination flags here
00356          DUMPINFOFLAG_Standard =          (DUMPINFOFLAG_Subobjects | DUMPINFOFLAG_FullHeader),
00357          DUMPINFOFLAG_Maximal =           (DUMPINFOFLAG_Subobjects | DUMPINFOFLAG_FullHeader | DUMPINFOFLAG_ObjectData)
00358          };
00359          
00360       enum LINKFILEFLAGS {
00361          LINKFILEFLAG_None =              0x00000000,       //!< Get only the link information for the object
00362          LINKFILEFLAG_SearchChildren =    0x00000001        //!< Get link information for the object and children
00363          };
00364          
00365       enum OPENMODE {               //! Mode for opening rvc files and objects, mutually exclusive
00366          OPENMODE_NotOpen = 0,      //!< Returned by GetOpenMode() if the rvc file / object is not open
00367          OPENMODE_Read,             //!< Open file with 'read' access
00368          OPENMODE_Write,            //!< Open file with 'write' access
00369          OPENMODE_WriteAttempt,     //!< Attempt to open the file for writing, if failed, open for reading only
00370          OPENMODE_ReadNoLock,       //!< Open file generating no lock files, used for system resource files
00371          OPENMODE_WriteAbsolute,    //!< Override ReadAbsolute system flag for a specific file
00372          OPENMODE_ReadAbsolute,     //!< File is to be opened read-only, no lock file and no possibility of change
00373          OPENMODE_WriteNoLock       //!<  Open file generating no lock files, used for system resource files
00374          };
00375 
00376       enum TEMPFILE {
00377          TEMPFILE_DeleteOnClose = 0x00000100,
00378          TEMPFILE_DeleteOnExit =  0x00000200
00379          };
00380 
00381       
00382       // NESTED CLASSES
00383       // FORWARD Declarations
00384       #ifndef GENERATING_DOXYGEN_OUTPUT
00385       class CONST_ITERATOR;
00386       friend class CONST_ITERATOR;
00387       class ITERATOR;
00388       friend class ITERATOR;
00389       class FILTER;
00390       class FILTER_OBJTYPESET;
00391       class FILTER_NEWERTHANPARENT;
00392       class TOPLEVELNAMECHANGE;
00393       friend class TOPLEVELNAMECHANGE;
00394       class UNIQUENAMEFILTER;
00395       class UNIQUECHILDNAMEFILTER;
00396       #endif // GENERATING_DOXYGEN_OUTPUT
00397 
00398       //! Default constructor
00399       OBJECT (                   //! Empty constructor, must attach to an object using Attach()
00400          );
00401 
00402       //! Copy constructor
00403       OBJECT (                   //! Copy Constructor
00404          const RVC::OBJECT& obj
00405          );
00406 
00407       //! Destructor
00408       virtual ~OBJECT (
00409          );
00410 
00411       //! Assignment.  Will close if necessary and reopen if 'rhs' is open
00412       RVC::OBJECT& operator= (               //! Assignment operator
00413          const RVC::OBJECT& rhs
00414          );
00415 
00416       //! Attach an OBJECT instance to a rvc file root folder using a FILEPATH
00417       //!
00418       //! This will open the file to determine parameter correctness.
00419       //! If the class is derived, this function will fail and return an error.
00420       ERRVALUE Attach (
00421          const FILEPATH& FilePath         //!< Location of file to attach to
00422          );
00423 
00424       //! Attach an OBJECT instance to a file using the FILEPATH and inode number
00425       //!
00426       //! This will open the file to determine parameter correctness.
00427       //! If the derived class cannot handle the rvc object type, the rvc object is not attached and an error is returned
00428    //!   #ifndef NO_DEPRECATED
00429       ERRVALUE Attach (
00430          const FILEPATH& FilePath,        //!< Location of file to attach to
00431          const RVCINODENUM InodeNum       //!< RVC inode to attach to
00432          );
00433    //!   #endif
00434 
00435       //! Attach an OBJECT instance to a file using an OBJITEM
00436       //!
00437       //! This will open the file to determine parameter correctness
00438       //! If the derived class cannot handle the rvc object type, the rvc object is not attached and an error is returned
00439       ERRVALUE Attach (
00440          const RVC::OBJITEM& ObjItem         //!< Item containing file and rvc object location to attach to
00441          );
00442 
00443       //! Attach an OBJECT instance to a file using the FilePath and an rvc object path
00444       //!
00445       //! This will open the file to determine parameter correctness and locate the correct rvc object.
00446       //! If the derived class cannot handle the rvc object type, the rvc object is not attached and an error is returned
00447       ERRVALUE Attach (
00448          const FILEPATH& FilePath,        //!< Location of project file to open
00449          const MISTRING& ObjectPath       //!< Location of rvc object in project file to open
00450          );
00451 
00452       //! Attach an OBJECT instance to a file using a parent rvc object, child rvc object type and child name
00453       //!
00454       //! This will open the file to determine parameter correctness and locate the correct rvc object.
00455       //! If the derived class cannot handle the rvc object type, the rvc object is not attached and an error is returned
00456       ERRVALUE Attach (
00457          const RVC::OBJECT& parent,       //!< Parent object to look for the correct child
00458          const RVC::OBJTYPE ObjType,            //!< Child rvc object type to attach to
00459          const RVC::OBJECTNAME& name         //!< Name of child rvc object to attach to
00460          );
00461 
00462       //! Attach an RVC::OBJECT instance to a file using a source rvc object, possible relative path, and rvc object path
00463       //!
00464       //! This will open the file to determine parameter correctness and location of the correct rvc object.
00465       //! If the derived class cannot handle the rvc object type, the rvc object is not attached and an error is returned
00466       ERRVALUE Attach (
00467          const RVC::OBJECT& source,       //!< If 'filename' is relative, this specifies the source path
00468          const UNICODE *filename,         //!< Location of rvc file, can be a relative path
00469          const MISTRING& ObjectPath       //!< Location of rvc object in the rvc file
00470          );
00471 
00472       //! Attach an RVC::OBJECT instance to a file using its twin.
00473       //!
00474       //! This will open the file if the twin's file is open
00475       //! If the derived class cannot handle the rvc object type, the rvc object is not attached and an error is returned
00476       ERRVALUE Attach (
00477          const RVC::OBJECT& twin
00478          );
00479 
00480       //! Attach an OBJECT instance to an OBJITEM's parent
00481       //!
00482       //! This will open the file to determine parameter correctness
00483       //! If the derived class cannot handle the rvc object type, the rvc object is not attached and an error is returned
00484       ERRVALUE AttachToParent (
00485          const RVC::OBJITEM& ObjItem         //!< Item containing file and rvc object location to attach to
00486          );
00487 
00488       //! Determine if the rvc file can be opened for writing, irregardless of its current open state
00489       //!
00490       //! Object must be attached or false is returned
00491       //! This function does not check if another process or thread has a write lock on the file, it
00492       //! determines that the file \b CAN be opened for writing.
00493       //! @return true if file is writable and the RVC system allows writing, false if cannot open for write
00494       bool CanOpenForWrite (                 //! Is file read-only?  (Object cannot be opened for writing)
00495          ) const;
00496 
00497       //! Change the rvc object description
00498       //! Object must be open with OPENMODE_Write
00499       ERRVALUE ChangeDesc (
00500          const RVC::OBJECTDESC& NewDesc         //!< New description for the object
00501          );
00502 
00503       //! Change the rvc object name
00504       //! Object must be open with OPENMODE_Write
00505       ERRVALUE ChangeName (
00506          const RVC::OBJECTNAME& NewName         //!< New name for the object
00507          );
00508 
00509       //! Change the rvc object that this object is linked to
00510       //! Object must be open with OPENMODE_Write
00511       ERRVALUE ChangeObjectLink (
00512          const RVC::LINKITEM& LinkItem
00513          );
00514 
00515       //! Change the rvc object source
00516       //! Object must be open with OPENMODE_Write
00517       ERRVALUE ChangeSource (
00518          const RVC::OBJECTSOURCE& NewSource     //!< New source name for the object
00519          );
00520 
00521       //! Change the temp file mode to TEMPFILE_DeleteOnClose or TEMPFILE_DeleteOnExit 
00522       ERRVALUE ChangeTempFileMode (
00523          TEMPFILE flags
00524          );
00525          
00526       //! Obtain a const rvc child object iterator given an rvc object type.  This iterator can be used to step through 
00527       //! all of the children of 'this'.
00528       //! @return A constant iterator to the first child that meets the specifications
00529       CONST_ITERATOR ChildListBegin (        //! Get iterator to the beginning of the child list
00530          RVC::OBJTYPE m_ObjType                 //!< Object type of children to search for
00531          ) const;
00532       
00533       //! Obtain a rvc child object iterator given an rvc object type.  This iterator can be used to step through 
00534       //! all of the children of 'this'.
00535       //! @return An iterator to the first child that meets the specifications
00536       ITERATOR ChildListBegin (           //! Get iterator to the beginning of the child list
00537          RVC::OBJTYPE m_ObjType                 //!< Object type of children to search for
00538          );
00539 
00540       //! Obtain a const rvc child object iterator that points to the end of the list.
00541       //! @return A constant iterator to the end of the child list
00542       CONST_ITERATOR ChildListEnd (       //! Get iterator to the child list end
00543          ) const;
00544 
00545       //! Obtain a rvc child object iterator that points to the end of the list.
00546       //!
00547       //! @return An iterator to the end of the child list
00548       ITERATOR ChildListEnd (             //! Get iterator to the child list end
00549          );
00550 
00551       //! Close the rvc object
00552       //!
00553       //! Will close the file and the rvc object if the derived class supports the paradigm.  The instance is still considered attached.
00554       ERRVALUE Close (                 //! Close the open file/object
00555          );
00556 
00557       //! Compute project file free space
00558       //! @return Amount of project file free space
00559       INT64 ComputeProjectFileFreeSpace (
00560          ) const;
00561          
00562       //! Make a copy of the rvc object, and its children, to another place specified by the destination parent object.
00563       //! Does not copy DBTABLE objects.  Use RVC::DBASE::CopyTableTo() method.
00564       ERRVALUE CopyTo (
00565          RVC::OBJECT& DestParentObj,         //!< Parent object to copy object and children to
00566          RVC::OBJECT& DestObj,               //!< Attached instance to destination object
00567          COPYFLAGS CopyFlags = COPYFLAG_None
00568          ) const;
00569 
00570       //! Make a copy of the rvc object, and its children, to another place specified by the destination parent object.
00571       //! Does not copy DBTABLE objects.  Use RVC::DBASE::CopyTableTo() method.
00572       ERRVALUE CopyTo (
00573          RVC::OBJECT& DestParentObj,         //!< Parent object to copy object and children to
00574          RVC::OBJECT& DestObj,               //!< Attached instance to destination object
00575          const RVC::OBJECTNAME& name,        //!< New name of copied object
00576          const RVC::OBJECTDESC& desc,        //!< New description of copied object
00577          COPYFLAGS CopyFlags = COPYFLAG_None,
00578          const char *Source = 0              //!< New source of copied object, default is GetAppName()
00579          ) const;
00580 
00581       //! Make a copy of the rvc object, and its children, to another place specified by the destination parent object.
00582       //! Does not copy DBTABLE objects.  Use RVC::DBASE::CopyTableTo() method.
00583       ERRVALUE CopyTo (
00584          RVC::OBJECT& DestParentObj,         //!< Parent object to copy object and children to
00585          RVC::OBJECT& DestObj,               //!< Attached instance to destination object
00586          FILTER& filter,                     //!< Method called with an rvc object to determine fitness to copy
00587          COPYFLAGS CopyFlags = COPYFLAG_None
00588          ) const;
00589 
00590       //! Make a copy of the rvc object, and its children, to another place specified by the destination parent object.
00591       //! Does not copy DBTABLE objects.  Use RVC::DBASE::CopyTableTo() method.
00592       ERRVALUE CopyTo (
00593          RVC::OBJECT& DestParentObj,         //!< Parent object to copy object and children to
00594          RVC::OBJECT& DestObj,               //!< Attached instance to destination object
00595          FILTER& filter,                     //!< Method called with an rvc object to determine fitness to copy
00596          const RVC::OBJECTNAME& name,        //!< New name of copied object
00597          const RVC::OBJECTDESC& desc,        //!< New description of copied object
00598          COPYFLAGS CopyFlags = COPYFLAG_None,
00599          const char *Source = 0              //!< New source of copied object, default is GetAppName()
00600          ) const;
00601 
00602       //! Copy rvc object's children to the given destination parent object
00603       ERRVALUE CopyChildrenTo (
00604          RVC::OBJECT& DestParentObj,         //!< Parent to copy children to.
00605          COPYFLAGS CopyFlags = COPYFLAG_None
00606          ) const;
00607 
00608       //! Copy rvc object's children to the given destination parent object with filter
00609       ERRVALUE CopyChildrenTo (
00610          RVC::OBJECT& DestParentObj,         //!< Parent to copy children to.
00611          FILTER& filter,                     //!< Method called with an rvc object to determine fitness to copy
00612          COPYFLAGS CopyFlags = COPYFLAG_None
00613          ) const;
00614 
00615       //! Delete the rvc object.  The method will call Close().
00616       //!
00617       //! For this function to work correctly, <b>ALL</b> instances that refer to this object must be closed.
00618       //! This method does not support delete when all closed paradigm.
00619       ERRVALUE Delete (                //! Delete the RVC::OBJECT
00620          );
00621 
00622       //! Detach instance from RVC object
00623       //!
00624       //! Will close the object and file
00625       void Detach (                    //! Close and unattach the file representing this RVC::OBJECT
00626          );
00627 
00628       //! Dump object information into a MISTRING reference
00629       ERRVALUE DumpObjectInfo (
00630          MISTRING& LogString,
00631          DUMPINFOFLAGS DumpInfoFlags = DUMPINFOFLAG_Minimal       //!< Controls how much information is placed into "LogString'
00632          );
00633          
00634       //! Locate rvc child object based on rvc child default object type and given name
00635       //!
00636       //! This routine determines the derived class default rvc object type and uses that for its search.
00637       //!  Object must be open for this method to work.  Returns false if not
00638       //! @return true if rvc object found and child sucessfully attached, false if not
00639       bool FindChild (                 //! Find child RVC::OBJECT by RVC::OBJECTNAME, if exists
00640          RVC::OBJECT& Child,                 //!<  Child object attached if found
00641          const RVC::OBJECTNAME& name            //!< Name of rvc child object to find
00642          ) const;
00643 
00644       //! Locate rvc child object based on rvc child default object type, given name, and a filter object
00645       //!
00646       //! This routine determines the derived class default rvc object type and uses that for its search.
00647       //!  Object must be open for this method to work.  Returns false if not
00648       //! @return true if rvc object found and child sucessfully attached, false if not
00649       bool FindChild (                 //! Find child RVC::OBJECT by RVC::OBJECTNAME and filter, if exists
00650          RVC::OBJECT& Child,                 //!<  Child object attached if found
00651          const RVC::OBJECTNAME& name,        //!< Name of rvc child object to find
00652          FILTER& filter                      //!< Method called with an rvc object to determine child fitness
00653          ) const;
00654 
00655       //! Locate rvc child object based on object path
00656       //!
00657       //! This routine locates the proper rvc object using the child's filepath and the rvc object path.
00658       //!  Object must be attached for this method to work.  Returns false if not
00659       //! @return true if rvc object found and child sucessfully attached, false if not
00660       bool FindChild (                 //! Find child RVC::OBJECT by RVC Object Path, if exists
00661          RVC::OBJECT& Child,                 //!<  Child object attached if found
00662          const MISTRING& ObjectPath       //!< RVC object path to look for child with
00663          ) const;
00664 
00665       //! Locate last used rvc child object based on child rvc object type
00666       //!
00667       //! This routine determines the derived class default rvc object type and uses that for its search.
00668       //!  Object must be open for this method to work.  Returns false if not
00669       //! @return true if rvc object found and child sucessfully attached, false if not
00670       bool FindChildLastUsed (            //! Last used RVC::OBJECT if found assigned to "Child"
00671          RVC::OBJECT& Child                  //!< RVC Child object attached if found
00672          ) const;
00673 
00674       //! Locate last used rvc child object based on child rvc object type and a filter object
00675       //!
00676       //! This routine determines the derived class default rvc object type and uses that for its search.
00677       //!  Object must be open for this method to work.  Returns false if not
00678       //! @return true if rvc object found and child sucessfully attached, false if not
00679       bool FindChildLastUsed (         //! Last used RVC::OBJECT if found assigned to "Child"
00680          RVC::OBJECT& Child,           //!<  Child object attached if found
00681          FILTER& filter                //!< Method called with an rvc object to determine fitness
00682          ) const;
00683 
00684       //! Update file information stored in caches to the file itself      
00685       ERRVALUE FlushFile (
00686          );
00687 
00688       //! Generate a unique object name based on the passed in filter
00689       static ERRVALUE GenerateUniqueName (
00690          RVC::OBJECTNAME& name,
00691          UNIQUENAMEFILTER& filter
00692          );
00693 
00694       //! Determine the number of children under this rvc object
00695       //!
00696       //!  Object must be opened for this method to work
00697       //! @return number of children found
00698       INT32 GetChildCount (               //! Count of children or ERRVALUE RETURNED
00699          RVC::OBJTYPE otype = RVC::OBJTYPE_All           //!< Type of rvc object to count, RVC::OBJTYPE_All to count all children
00700          ) const;
00701 
00702       //! Determine the number of children under this rvc object
00703       //!
00704       //!  Object must be opened for this method to work
00705       //! @return number of children found
00706       INT32 GetChildCount (               //! Count of children or ERRVALUE RETURNED
00707          RVC::OBJTYPE otype,              //!< Type of rvc object to count, RVC::OBJTYPE_All to count all children
00708          FILTER& filter                   //!< Method called with an rvc object to determine fitness
00709          ) const;
00710 
00711       //! Determine the number of children under this rvc object
00712       //!
00713       //!  Object must be opened for this method to work
00714       //! @return number of children found
00715       INT32 GetChildList (
00716          RVC::OBJTYPE ObjType,            //!< Type of rvc object to count, RVC::OBJTYPE_All to count all children
00717          RVC::OBJITEMLIST& ObjItemList,   //!< List of children RETURNED
00718          FILTER* filter = 0               //!< Method called with an rvc object to determine fitness
00719          ) const;
00720 
00721       //! Obtain the rvc object description
00722       //!
00723       //!  Object must be opened for this method to work
00724       ERRVALUE GetDescription (
00725          RVC::OBJECTDESC& Desc                  //!< Place to put rvc object description
00726          ) const;
00727 
00728       //! Obtain the default object type for the object instance
00729       //! @return The default object type for 'this'.  The default value is RVC::OBJTYPE_File.
00730       RVC::OBJTYPE GetDftObjectType (
00731          ) const;
00732 
00733       //! Get the RVC file handle associated with this RVC::OBJECT instance
00734       //!
00735       //! Used to integrate object classes with old functions, as soon as old functions are
00736       //! DEPRECATED, this method is RETIRED.
00737       //! The instance must be open to get a valid handle
00738    //!   #ifndef NO_DEPRECATED
00739       int GetFileHandle (                 //! For derived classes, gets the internal file handle
00740          ) const {
00741          return (GetFileHandlePro());
00742          }
00743    //!   #endif
00744 
00745       //! Get the FILEPATH associated with this RVC::OBJECT instance
00746       //! @return The filepath associated with this object.  FILEPATH will be empty if the object is not attached 
00747       const FILEPATH& GetFilePath (
00748          ) const;
00749 
00750       //! Get the FILEPATH linked file associated with this RVC::OBJECT instance
00751       //! @return The filepath linked file associated with this object.  FILEPATH will be empty if the object link is not attached 
00752       const FILEPATH& GetFilePathLink (
00753          ) const;
00754 
00755       //! Get the RVCINODENUM associated with this RVC::OBJECT instance
00756    //!   #ifndef NO_DEPRECATED
00757       RVCINODENUM GetInodeNum (           //! Internal inode number returned, for derived classes
00758          ) const {
00759          return (GetInodeNumPro());
00760          }
00761    //!   #endif
00762    
00763       //! Obtain link file information for this object and/or children
00764       ERRVALUE GetLinkedFiles (
00765          MILIST<LINKITEM>& LinkFileList,
00766          LINKFILEFLAGS LinkFileFlags = LINKFILEFLAG_None
00767          ) const;
00768 
00769       //! Obtain the rvc object name
00770       //!
00771       //! The object must be opened for this method to work
00772       ERRVALUE GetName (
00773          RVC::OBJECTNAME& Name               //!< Object name RETURNED
00774          ) const;
00775 
00776       //! Fill in the RVC::OBJITEM for the location of this object
00777       //!
00778       //! The object must be attached for this method to work
00779       ERRVALUE GetObjectItem (
00780          RVC::OBJITEM& ObjectItem            //!< Object Item RETURNED
00781          ) const;
00782 
00783       //! Determine the RVC Object Path from the root to this object
00784       //!
00785       //! The object must be attached for this method to work
00786       //! This rvc object path is defined to be a UNICODE string containing the heirarchy from the file root
00787       //! rvc object to the rvc object referenced by this instance.  It is used in specific Attach() and Open() methods.
00788       ERRVALUE GetObjectPath (
00789          MISTRING& ObjectPath          //!< Path to the rvc object from the root(file) rvc object.
00790          ) const;
00791 
00792       //! Get the RVC::OBJTYPE_... associated with this RVC::OBJECT instance
00793       //! @return The RVC::OBJTYPE_...associated with this object.
00794       RVC::OBJTYPE GetObjectType (
00795          ) const;
00796       
00797       //! Obtain object type from defined tag
00798       //! @return The RVC::OBJTYPE_...associated with this tag
00799       static RVC::OBJTYPE GetObjectTypeFromTag (
00800          const char* tag
00801          );
00802 
00803       //! Obtain object type from defined tag
00804       //! @return The RVC::OBJTYPE_...associated with this tag
00805       static RVC::OBJTYPE GetObjectTypeFromTag (
00806          const UNICODE* tag
00807          );
00808 
00809       //! Obtain the parent rvc object.  If the rvc object is RVC::OBJTYPE_File, the parent rvc object returned is the same 
00810       //! as the rvc object
00811       //!
00812       //! The  Object must be opened for this method to work
00813       ERRVALUE GetParent (
00814          RVC::OBJECT& ObjParent              //!< Parent object attached if sucessful
00815          ) const;
00816 
00817       //! Obtain the product version number which this rvc object was created
00818       //!
00819       //! The  Object must be opened for this method to work
00820       ERRVALUE GetProductVersion (
00821          UINT16& ProductVersion           //!< TNT product version in the form of MMmm (M - Major, m - minor) RETURNED
00822          ) const;
00823 
00824       //! Obtain the size of this rvc object in bytes
00825       //!
00826       //! The  Object must be opened for this method to work
00827       ERRVALUE GetSize (
00828          UINT64& size                  //!< Size of opened rvc object RETURNED
00829          ) const;
00830 
00831       //! Obtain the creation source string for this rvc object
00832       //!
00833       //! The  Object must be opened for this method to work
00834       ERRVALUE GetSource (
00835          RVC::OBJECTSOURCE& Source           //!< RVC Object creation source name RETURNED
00836          ) const;
00837          
00838       //! Obtain TEXTID from defined object type
00839       //! @return The TEXTID associated with the RVC::OBJTYPE_...
00840       static TEXTID GetTextIDFromObjectType (
00841          OBJTYPE ObjType
00842          );
00843 
00844       //! Obtain the creation time for this rvc object
00845       //!
00846       //! The  Object must be opened for this method to work
00847       void GetTimeCreate (
00848          DATETIME& Create              //!< Creation time RETURNED
00849          ) const;
00850 
00851       //! Obtain the Last Modified Time for this rvc object
00852       //!
00853       //! The  Object must be opened for this method to work
00854       ERRVALUE GetTimeLastMod (
00855          DATETIME& LastMod             //!< Last modified time RETURNED
00856          ) const;
00857 
00858       //! Obtain the Last Used Time for this rvc object
00859       //!
00860       //! The  Object must be opened for this method to work
00861       ERRVALUE GetTimeLastUsed (
00862          DATETIME& LastUsed               //!< Last used time RETURNED
00863          ) const;
00864          
00865       //! Get the number of available undo levels
00866       //! @return Number of available undo levels
00867       INT32 GetUndoNumLevels (
00868          ) const;
00869 
00870       //! Is this RVC::OBJECT attached to a RVC object?
00871       bool IsAttached (
00872          ) const;
00873          
00874       //! Is this RVC::OBJECT a child of the given parent?
00875       bool IsChildOf (
00876          const RVC::OBJECT& parent           //!< Parent object to test
00877          ) const;
00878 
00879       //! Do the two rvc object instances refer to the same RVC object?
00880       //! If either are unattached, this method returns false
00881       bool IsEqual (
00882          const RVC::OBJECT& rhs           //!< RVC Object to compare to
00883          ) const;
00884          
00885       //! Is the file a link file or not
00886       //! @return True if the file is linked, false if not
00887       bool IsFileLinked (
00888          ) const;
00889 
00890       //! Is this rvc object a root file rvc object?
00891       bool IsFileObject (
00892          ) const;
00893 
00894       //! Is the object / file created by TNTlite
00895       //! @return True if the object / file is created by TNTlite, false if not
00896       bool IsLiteCreated (
00897          ) const;
00898 
00899       //! Is the object a link object or not
00900       //! @return True if the object is linked, false if not
00901       bool IsObjectLinked (
00902          ) const;
00903 
00904       //! Is the object older than the passed in object, using the last modified timestamp
00905       //! @return True if 'this' is older than 'Object', false if not
00906       bool IsOlderThan (
00907          const RVC::OBJECT& Object
00908          ) const;
00909 
00910       //! Determine if rvc object is opened
00911       //! @return True if rvc object is opened
00912       bool IsOpen (
00913          ) const;             
00914 
00915       //! Determine if the attached rvc file is a temporary file
00916       //! @return True if file is temporary, False if not
00917       bool IsTempFile (
00918          ) const;
00919       
00920       //! Is this rvc object a child of a folder or the root file rvc object?
00921       bool IsTopObject (
00922          ) const;             
00923 
00924       //! Is the rvc object opened for writing
00925       bool IsWritable (
00926          ) const;
00927 
00928       //! Create a RVC file
00929       //!
00930       //! This method will create a project (RVC) file using the given location
00931       ERRVALUE MakeFile (
00932          const FILEPATH& FilePath,        //!< Place to create the file
00933          const RVC::OBJECTDESC& desc         //!< Description to give the file
00934          );
00935 
00936       //! Create a RVC link object under 'this'
00937       //!
00938       //! This method will create a linked object (NewLinkObject) to an existing RVC object (LinkToObject)
00939       ERRVALUE MakeLink (
00940          const RVC::OBJECT& LinkToObject,
00941          RVC::OBJECT& NewLinkObject,         //!< Only attached to the new link, not opened
00942          bool LinkToSubobjects = false
00943          );
00944 
00945       //! Create a RVC link object under 'this'
00946       //!
00947       //! This method will create a linked object (NewLinkObject) to an existing RVC object (LinkToObject)
00948       ERRVALUE MakeLink (
00949          const RVC::OBJECT& LinkToObject,
00950          RVC::OBJECT& NewLinkObject,         //!< Only attached to the new link, not opened
00951          const OBJECTNAME& name,
00952          const OBJECTDESC& desc,
00953          bool LinkToSubobjects = false
00954          );
00955 
00956       //! Create a RVC file as a temporary file
00957       //!
00958       //! This method will create a temporary RVC file using the temporary file path 
00959       //! with the largest free space.
00960       ERRVALUE MakeTempFile (
00961          TEMPFILE flags = TEMPFILE_DeleteOnClose      //!< Determines if to delete the temp file on closing of the file, or when the process ends
00962          );
00963 
00964       //! Open an <b>attached</b> RVC::OBJECT instance
00965       //!
00966       //! This method will open the file and derived rvc class object if possible
00967       //! If the instance is already open and the OPENMODE is not different, this
00968       //! method will return without doing anything, else it will Close() then Open()
00969       //! the instance.
00970       //! The instance must be attached for this to work
00971       ERRVALUE Open (
00972          OPENMODE OpenMode = OPENMODE_Read,  //!< Mode in which to open the rvc object
00973          MDLGPARENT widget = 0               //!< Parent dialog handle, 0 for default handle
00974          );
00975 
00976       //! Open an RVC::OBJECT instance using another instance to the same rvc object.
00977       //!
00978       //! This method will attach and open the file and derived rvc class object if possible.
00979       //! Use this method to re-open the rvc object using a different OPENMODE.
00980       ERRVALUE Open (
00981          const RVC::OBJECT& twin,            //!< Identical rvc object to open with a different OPENMODE
00982          OPENMODE OpenMode = OPENMODE_Read,  //!< Mode in which to open the rvc object
00983          MDLGPARENT widget = 0            //!< Parent dialog handle, 0 for default handle
00984          );
00985 
00986       //! Open an RVC::OBJECT instance using the rvc object's parent, type of rvc object, and the rvc object's name
00987       //!
00988       //! This method will attach and locate the rvc object and open the file and derived rvc class object if possible
00989       ERRVALUE Open (
00990          const RVC::OBJECT& parent,       //!< Parent rvc object to search under
00991          const RVC::OBJTYPE ObjType,            //!< Type of rvc object to look for
00992          const RVC::OBJECTNAME& name,        //!< Name of rvc object to look for
00993          OPENMODE OpenMode = OPENMODE_Read,  //!< Mode in which to open the rvc object
00994          MDLGPARENT widget = 0            //!< Parent dialog handle, 0 for default handle
00995          );
00996 
00997       //! Open an RVC::OBJECT instance to a rvc root folder using the given file location
00998       //!
00999       //! This method will attach and open the file
01000       //! If the class is derived, this function will fail and return an error.
01001       ERRVALUE Open (
01002          const FILEPATH& FilePath,        //!< Location of file to attach to
01003          OPENMODE OpenMode = OPENMODE_Read,  //!< Mode in which to open the rvc object
01004          MDLGPARENT widget = 0            //!< Parent dialog handle, 0 for default handle
01005          );
01006 
01007    //!   #ifndef NO_DEPRECATED
01008       //! Open an RVC::OBJECT instance using the given file location and rvc object inode
01009       //!
01010       //! This method will attach and open the file and derived rvc class object if possible
01011       //! <b>This is a legacy method, it will be DEPRECATED as soon as possible</b>
01012       //! Read Goal item 3 for reason
01013       ERRVALUE Open (
01014          const FILEPATH& FilePath,        //!< Location of file to open
01015          const RVCINODENUM InodeNum,
01016          OPENMODE OpenMode = OPENMODE_Read,  //!< Mode in which to open the rvc object
01017          MDLGPARENT widget = 0            //!< Parent dialog handle, 0 for default handle
01018          );
01019          
01020       //! Open an RVC::OBJECT instance using the given open object id
01021       //!
01022       //! This method will attach and open the file and derived rvc class object if possible
01023       //! <b>This is a legacy method, it will be DEPRECATED as soon as possible</b>
01024       //! Read Goal item 3 for reason
01025       ERRVALUE Open (
01026          int ObjectID,                       //!< Legacy open object ID handle
01027          OPENMODE OpenMode = OPENMODE_Read,  //!< Mode in which to open the rvc object
01028          MDLGPARENT widget = 0            //!< Parent dialog handle, 0 for default handle
01029          );
01030    //!   #endif
01031 
01032       //! Open an RVC::OBJECT instance using a RVC::OBJITEM instance
01033       //!
01034       //! This method will attach and open the file and derived rvc class object if possible
01035       ERRVALUE Open (
01036          const RVC::OBJITEM& ObjItem,        //!< This contains the file and rvc object location information
01037          OPENMODE OpenMode = OPENMODE_Read,  //!< Mode in which to open the rvc object
01038          MDLGPARENT widget = 0            //!< Parent dialog handle, 0 for default handle
01039          );
01040 
01041       //! Open an RVC::OBJECT instance using the given file location and rvc object path
01042       //!
01043       //! This method will attach and locate the rvc object and open the file and derived rvc class object if possible
01044       ERRVALUE Open (
01045          const FILEPATH& FilePath,        //!< Location of file to open
01046          const MISTRING& ObjectPath,         //!< Full name of rvc object obtained from GetObjectPath()
01047          OPENMODE OpenMode = OPENMODE_Read,  //!< Mode in which to open the rvc object
01048          MDLGPARENT widget = 0            //!< Parent dialog handle, 0 for default handle
01049          );
01050 
01051       //! Open an RVC::OBJECT instance using a source rvc object, possible relative path, and rvc object path
01052       //!
01053       //! This method will attach and open the file and derived rvc class object if possible
01054       ERRVALUE Open (
01055          const RVC::OBJECT& source,       //!< Source rvc object used if 'filename' is a relative path
01056          const UNICODE *filename,         //!< Full or relative path to the rvc file to open
01057          const MISTRING& ObjectPath,         //!< Full name of rvc object obtained from GetObjectPath()
01058          OPENMODE OpenMode = OPENMODE_Read,  //!< Mode in which to open the rvc object
01059          MDLGPARENT parent = 0            //!< Parent dialog handle, 0 for default handle
01060          );
01061 
01062       //! Open a parent of an RVC::OBJECT instance using a RVC::OBJITEM instance
01063       //!
01064       //! This method will attach and open the file and derived rvc class object if possible
01065       ERRVALUE OpenParent (
01066          const RVC::OBJITEM& ObjItem,        //!< This contains the file and rvc object location information
01067          OPENMODE OpenMode = OPENMODE_Read,  //!< Mode in which to open the rvc object
01068          MDLGPARENT widget = 0            //!< Parent dialog handle, 0 for default handle
01069          );
01070 
01071       //! Perform project file recovery to the output object specified
01072       ERRVALUE RecoverProjectFileTo (
01073          RVC::OBJECT& OutputObject,
01074          MISTRING& LogString
01075          );
01076    
01077       //! Redo (reinstate) changes made by an undo operation, if enabled
01078       ERRVALUE RedoChanges (
01079          );
01080          
01081       //! Search children of 'this' for any children that are invalid due to:
01082       //! 1.  Violation of parent object rules (child cannot be under this parent object)
01083       //! 2.  Singleton violation:  There can be only one object of this type under the parent
01084       ERRVALUE SearchForInvalidChildObjects (
01085          bool SearchAllSubLevels,                     //!< 'false' to return only the first level children, true to do levels of children
01086          OBJITEMLIST& InvalidChildList,            //!< List of children that violate parent object rules  (child cannot be under this parent object)
01087          OBJITEMLIST& SingletonChildList        //!< Singleton violation:  There can be only one object of this type under the parent
01088          ) const;
01089 
01090       ERRVALUE SetMinimumTNTVersion (
01091          UINT16 Version = 0         //!< Default is to the current version
01092          );
01093          
01094       //! Modify the rvc object's TimeLastUsed field to the current time
01095       //!
01096       //! The  object must be opened for writing
01097       ERRVALUE SetTimeLastUsed (
01098          );
01099 
01100       //! Modify the rvc object's TimeLastUsed field to the time given
01101       //!
01102       //! The  object must be opened for writing
01103       ERRVALUE SetTimeLastUsed (
01104          const DATETIME& NewTime          //!< Date / Time to set the rvc object's "last used" field
01105          );
01106 
01107       //! Modify the rvc object's TimeLastModified field to the current time
01108       //!
01109       //! The  object must be opened for writing
01110       ERRVALUE SetTimeLastMod (
01111          );
01112 
01113       //! Modify the rvc object's TimeLastModified field to the time given
01114       //!
01115       //! The rvc object must be opened for writing
01116       ERRVALUE SetTimeLastMod (
01117          const DATETIME& NewTime          //!< Date / Time to set the rvc object's "last modified" field
01118          );
01119 
01120       //! Set the maximum number of undo levels
01121       ERRVALUE SetUndoMaxLevel (
01122          INT32 NewLevel
01123          );
01124          
01125       //! Method to traverse an object link if 'this' references a RVC object link.
01126       //! If 'this' references a link, 'TraversedObject' will be attached to the linked to object, if 'this'
01127       //! is not a link, 'TraversedObject' will be attached to 'this'.
01128       //! @return '1' if the link existed and was traversed, '0' if not a link, < 0 error
01129       ERRVALUE TraverseLink (
01130          RVC::OBJECT& TraversedObject
01131          );
01132          
01133       //! Undo changes made from the last undo mark      
01134       ERRVALUE UndoChanges (
01135          bool SetRedo = false             //!< Set redo information to undo the undo
01136          );
01137 
01138       //! Clear out all undo information     
01139       ERRVALUE UndoClear (
01140          );
01141          
01142       //! Mark a spot for an undo call to undo to.  This first call to this function
01143       //! marks the initial position for undo and enables undo for this file
01144       ERRVALUE UndoMark (
01145          );
01146       
01147       //! Update file information stored in object caches to the file itself     
01148       ERRVALUE UpdateFile (
01149          );
01150 
01151       //! Update "Last Used" time to be later than any like object.  Only updates the object if necessary.
01152       //! Guarentees this object will be selected be FindChildLastUsed()
01153       ERRVALUE UpdateTimeLastUsed (
01154          );
01155          
01156       //! Validate OBJECTNAME to specs
01157       static void ValidateName (
01158          RVC::OBJECTNAME& name
01159          );
01160 
01161    protected:
01162 
01163       virtual ERRVALUE v_GetName (RVC::OBJECTNAME& Name) const;
01164       virtual ERRVALUE v_GetDescription (RVC::OBJECTDESC& Desc) const;
01165 
01166       void AssignInfo (const RVCGENINFO& info);
01167       void AssignInode (RVCINODENUM inode);
01168 
01169       void CallOnNotifyRaw (UINT32 reason, void *data = 0);
01170       void CallOnChildCreate (const OBJECT& object);
01171       void CallOnChildOpen (const OBJECT& object);
01172       void CallOnChildClosing (const OBJECT& object);
01173       void CallOnClose ();
01174       void CallOnUndoBegin ();
01175       void CallOnUndoEnd ();
01176       void CallOnUndoPossible ();
01177       
01178       ERRVALUE CloseFile (             //! Close the open file
01179          );
01180 
01181       void CopyObject (
01182          const RVC::OBJECT& rhs
01183          );
01184 
01185       //! Get the RVC file handle associated with this RVCRVC::OBJECT instance
01186       //! The instance must be open to get a valid handle
01187       RVC::FILEHANDLE* GetFileInstance (                 //! For derived classes, gets the internal file handle
01188          ) const;
01189       
01190       //! Get the RVC file handle associated with this RVCRVC::OBJECT instance
01191       //! The instance must be open to get a valid handle
01192       int GetFileHandlePro (                 //! For derived classes, gets the internal file handle
01193          ) const;
01194       
01195       //! Get the RVCINODENUM associated with this RVC::OBJECT instance
01196       RVCINODENUM GetInodeNumPro (           //! Internal inode number returned, for derived classes
01197          ) const;
01198       
01199       //! Obtain current open mode for this rvc object instance.
01200       //! Used in copy constructors and assignment operators of derived classes to open the rvc object using
01201       //! the same OPENMODE as the 'rhs' rvc object instance
01202       //!
01203       //! @return Open mode of rvc object instance
01204       OPENMODE GetOpenMode (           //! Returns open object read or write, useful for copy and assignment
01205          ) const;
01206       
01207       bool IsFileOpen (                //! Is the file opened?
01208          ) const;
01209 
01210       ERRVALUE OpenFile (                 //! Open file only
01211          OPENMODE OpenMode,
01212          MDLGPARENT parent
01213          );
01214 
01215       ERRVALUE OpenRVCFile (const FILEPATH& filepath, OPENMODE OpenMode, MDLGPARENT parent);
01216       void SetMakeObject (const RVC::OBJECT& rhs);
01217 
01218       void SetBasicInfo (
01219          RVCGENINFO& ginfo,
01220          const RVC::OBJECT& parent,
01221          const RVC::OBJECTNAME& name,
01222          const RVC::OBJECTDESC& desc,
01223          const char *Source = 0              //!< New source of copied object, default is GetAppName()
01224          );
01225 
01226       ERRVALUE SetParent (const OBJITEM& ObjItem);
01227          
01228       UINT32 TranslateOpenFlags (            //! Translates OPENMODE to FILE_... flags
01229          OPENMODE flags
01230          ) const;
01231 
01232 
01233    private:
01234       #ifndef GENERATING_DOXYGEN_OUTPUT
01235 
01236       FILEPATH m_FilePath;    //!< File to re-open if closed
01237       FILEHANDLE* m_FileHandle;
01238       bool m_Attached;
01239       bool m_IsWritable;
01240       bool m_CanWrite;
01241 
01242       //! The members listed below are the members of RVCGENINFO that are inmutable for multi-threading purposes
01243       RVCDATETIME m_Create;
01244       OBJTYPE m_ObjectType;
01245       RVCINODENUM m_InodeNum;
01246       
01247       class TEMPOPENOBJECT;
01248       friend class TEMPOPENOBJECT;
01249       class FILTERTYPE;
01250       friend class FILTERTYPE;
01251       class FILTERFUNC;
01252       friend class FILTERFUNC;
01253 
01254       OBJECT (                   //! Constructor by file handle and inode number, used for internal creation
01255          const FILEHANDLE* FileHandle,
01256          RVCINODENUM InodeNum
01257          );
01258 
01259       OBJECT (                   //! Constructor by file index and inode number, used for internal creation
01260          int fhandle,
01261          RVCINODENUM InodeNum
01262          );
01263 
01264       bool operator== (const OBJECT& rhs) const;
01265       #endif // GENERATING_DOXYGEN_OUTPUT
01266       
01267       //! Called by the Close() method to close the derived class open handle, if possible and necessary
01268       //!
01269       //! If the derived class retains an open state with the rvc object, then the derived class MUST support this method
01270       //! The default behaviour is to return (0).
01271       //!
01272       //! If this method is supported, then the derived class must support IsObjectOpen() and OpenObject().
01273       virtual ERRVALUE v_CloseObject (
01274          );
01275 
01276       //! Called whenever a default object type is needed for comparison or default parameters.
01277       //!
01278       //! All derived classes that model a specific object must override this method and provide a correct
01279       //! RVC::OBJTYPE_... value.  The default value is RVC::OBJTYPE_File.
01280       virtual RVC::OBJTYPE v_GetDftObjectType (
01281          ) const;
01282 
01283       //! Can the derived class handle multiple object types.
01284       //!
01285       //! Used in caes where the object instance determines the object to look for
01286       virtual bool v_IsMultiObject (
01287          ) const;
01288 
01289       //! Called by the IsOpen() method to determine if the rvc object is open, if possible and necessary.
01290       //!
01291       //! If the derived class retains an open state with the rvc object, then the derived class MUST support this method
01292       //! The default behaviour is to return (true).
01293       //!
01294       //! If this method is supported, then the derived class must support CloseObject() and OpenObject().
01295       virtual bool v_IsObjectOpen (
01296          ) const;             
01297 
01298       //! Called by the Open() methods to open an rvc object.
01299       //!
01300       //! If the derived class retains an open state with the rvc object, then the derived class MUST support this method
01301       //! The default behaviour is to return (0).
01302       //!
01303       //! If this method is supported, then the derived class must support CloseObject() and IsObjectOpen().
01304       virtual ERRVALUE v_OpenObject (
01305          OPENMODE OpenMode,
01306          MDLGPARENT parent
01307          );
01308 
01309       //! Called to determine if the derived class can handle the specified object type
01310       //!
01311       //! All derived classes that model a specific object must override this method and test the validity of the 
01312       //! RVC::OBJTYPE_... value passed in.  The default value is true, since the RVC::OBJECT class can handle any object type
01313       virtual bool v_ValidateObjectType (
01314          const RVC::OBJTYPE otype
01315          ) const;
01316 
01317       #ifndef GENERATING_DOXYGEN_OUTPUT
01318       ERRVALUE AttachLow (
01319          const FILEPATH& FilePath,
01320          const RVCINODENUM InodeNum,
01321          OPENMODE OpenMode,               //!< Mode in which to open the object
01322          MDLGPARENT parent = 0            //!< Parent dialog handle, 0 for default handle
01323          );
01324 
01325       ERRVALUE AttachLow (
01326          const OBJITEM& ObjItem,
01327          OPENMODE OpenMode,               //!< Mode in which to open the object
01328          MDLGPARENT parent = 0            //!< Parent dialog handle, 0 for default handle
01329          );
01330 
01331       ERRVALUE AttachLow (
01332          const FILEPATH& FilePath,
01333          const MISTRING& ObjectPath,
01334          OPENMODE OpenMode,               //!< Mode in which to open the object
01335          MDLGPARENT parent = 0            //!< Parent dialog handle, 0 for default handle
01336          );
01337 
01338       ERRVALUE AttachLow (
01339          const OBJECT& parent,
01340          const OBJTYPE ObjType,
01341          const OBJECTNAME& name,
01342          OPENMODE OpenMode,               //!< Mode in which to open the object
01343          MDLGPARENT widget = 0            //!< Parent dialog handle, 0 for default handle
01344          );
01345 
01346       ERRVALUE AttachLow (
01347          const OBJECT& source,
01348          const UNICODE *filename,
01349          const MISTRING& ObjectPath,
01350          OPENMODE OpenMode,               //!< Mode in which to open the object
01351          MDLGPARENT parent = 0            //!< Parent dialog handle, 0 for default handle
01352          );
01353 
01354       static void CallbackFunc (MfAnyCallbackStruct *cb, void *data);
01355       #endif // GENERATING_DOXYGEN_OUTPUT
01356 
01357    };
01358 DEFINE_ENUM_OPERATORS(OBJECT::COPYFLAGS);
01359 
01360 
01361 //! Constant iterator class
01362 //!
01363 //! This class is used to iterate through a parent rvc object's children.  This construct replaces the MfGetList() routines.
01364 //! See methods ChildListBegin() and ChildListEnd() for obtaining an child iterator
01365 class OBJECT::CONST_ITERATOR {
01366    public:
01367 
01368       //! Default constructor
01369       CONST_ITERATOR (
01370          ) : 
01371          m_Iterator(0),
01372          m_CurrentObj(0),
01373          m_ObjType(OBJTYPE_All)
01374          {}
01375 
01376       //! Idiot constructor for G++
01377       explicit CONST_ITERATOR (
01378          int WorthlessValue
01379          ) : 
01380          m_Iterator(0),
01381          m_CurrentObj(0),
01382          m_ObjType(OBJTYPE_All)
01383          {}
01384 
01385       //! Copy constructor
01386       CONST_ITERATOR (
01387          const CONST_ITERATOR& rhs
01388          );
01389 
01390       //! Interanl constructor used by ChildListBegin() methods
01391       CONST_ITERATOR (
01392          const RVC::OBJECT* parent,
01393          RVC::OBJTYPE m_ObjType
01394          );
01395 
01396       //! Destructor
01397       virtual ~CONST_ITERATOR (
01398          );
01399 
01400       //! Assignment
01401       CONST_ITERATOR& operator= (
01402          const CONST_ITERATOR& rhs
01403          );
01404 
01405       //! Dereference
01406       const RVC::OBJECT& operator* (
01407          ) const {return (*m_CurrentObj);}
01408 
01409       //! Dereference arrow
01410       const RVC::OBJECT* operator-> (
01411          ) const {return (&**this);}
01412 
01413       //! Pre-increment
01414       CONST_ITERATOR& operator++ (
01415          );
01416 
01417       //! Comparison for equality
01418       bool operator== (
01419          const CONST_ITERATOR& rhs
01420          ) const {return (m_Iterator == rhs.m_Iterator);}
01421 
01422       //! Comparison for inequality
01423       bool operator!= (
01424          const CONST_ITERATOR& rhs
01425          ) const {return (!(*this == rhs));}
01426 
01427    protected:
01428       void *m_Iterator;
01429       OBJECT *m_CurrentObj;
01430       OBJTYPE m_ObjType;
01431    };
01432 
01433 
01434 //!