[GME-commit] GMESRC/GME/XmlBackEnd CoreXmlFile.cpp, 1.16,
1.17 CoreXmlFile.h, 1.5, 1.6
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Fri Jun 15 12:02:56 CDT 2007
Update of /project/gme-repository/GMESRC/GME/XmlBackEnd
In directory escher:/tmp/cvs-serv30980
Modified Files:
CoreXmlFile.cpp CoreXmlFile.h
Log Message:
XmlObjComp class for introducing ordered set based on guids.
SourceControlStat regnode for indicating saved files by others.
Trivial operation analysis.
LASTRELID attribute ignored in case of models/folders for not checking them out.
Useroptions loaded for simplifying operation in case of experienced users.
Permissive method for filesModifiedByOthers implemented.
Not invoking getLatestVersion upon every commit.
Syncing lastwritetime of objects with the time applied on the actual file after close happened.
Comment field of rootfolder is also multiline.
Files checked out as .tmp for comparison.
Files checked out with specific path instead of default (this might be reverted later.)
CVS User: Zoltan Molnar, ISIS (zolmol)
Index: CoreXmlFile.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/XmlBackEnd/CoreXmlFile.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** CoreXmlFile.cpp 8 Jun 2007 13:47:11 -0000 1.16
--- CoreXmlFile.cpp 15 Jun 2007 17:02:54 -0000 1.17
***************
*** 3,6 ****
--- 3,8 ----
#include <io.h>
#include <stdlib.h>
+ #include <direct.h>
+ #include <fstream>
#include "CoreXmlFile.h"
#include "CommonCollection.h"
***************
*** 12,15 ****
--- 14,24 ----
[...2263 lines suppressed...]
+ }
+ }
+
+ if( !mod_hasports)
+ {
+ if( mod_longref != 0)
+ m_portless[ mod_longref] = true;
+ }
+ }
+
+ delete parser;
+ }
+ catch(...)
+ {
+ if( parser) delete parser;
+ return false;
+ }
+
+ return true;
}
Index: CoreXmlFile.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/XmlBackEnd/CoreXmlFile.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** CoreXmlFile.h 2 Nov 2004 15:28:34 -0000 1.5
--- CoreXmlFile.h 15 Jun 2007 17:02:54 -0000 1.6
***************
*** 45,49 ****
class XmlObject;
! typedef std::set<XmlObject*> XmlObjSet;
typedef XmlObjSet::iterator XmlObjSetIter;
typedef std::vector<XmlObject*> XmlObjVec;
--- 45,56 ----
class XmlObject;
! struct XmlObjComp
! {
! bool operator()( XmlObject * p1, XmlObject * p2) const;
! };
!
!
!
! typedef std::set<XmlObject*, XmlObjComp> XmlObjSet; // ordered set, ensures xml files to look similar
typedef XmlObjSet::iterator XmlObjSetIter;
typedef std::vector<XmlObject*> XmlObjVec;
***************
*** 226,235 ****
bool m_modified;
bool m_sourceControlInfoRegNode;
CTime m_lastWriteTime;
friend class CCoreXmlFile;
};
-
struct UnresolvedPointer
{
--- 233,243 ----
bool m_modified;
bool m_sourceControlInfoRegNode;
+ bool m_sourceControlStatRegNode;
CTime m_lastWriteTime;
friend class CCoreXmlFile;
+ friend struct XmlObjComp;
};
struct UnresolvedPointer
{
***************
*** 259,262 ****
--- 267,317 ----
typedef UndoMap::iterator UndoMapIter;
+ class CCoreXmlFile;
+
+ class ParadigmInformation
+ {
+ public:
+ ParadigmInformation();
+
+ // operations
+ void clear ();
+ void load ( const std::string& p_folder, const std::string& p_parXmlFileName, CCoreXmlFile * const p_parent);
+ bool isLoaded () const;
+
+ bool portless ( long p_metaref);
+ bool portless ( const std::string& p_metaref);
+ bool isPort ( long p_metaref);
+ bool isPort ( const std::string& p_metaref);
+
+ protected:
+ bool parseXmp ( const std::string& p_filename);
+ bool createDtd ( const std::string& p_filename);
+
+ // members
+ const std::string m_parXmlFileName;
+ const std::string m_parCnfFileName;
+ bool m_loaded;
+
+ typedef std::map<long, bool> METAREF_MAP;
+ typedef METAREF_MAP::const_iterator METAREF_MAP_CITER;
+
+ METAREF_MAP m_isPort; // is a metaref a port?
+ METAREF_MAP m_portless; // has a model any ports
+ };
+
+ class OperatingOptions
+ {
+ public:
+ OperatingOptions();
+ void load( const std::string& p_folder, CCoreXmlFile * const p_parent);
+
+ // members
+ const std::string m_fileName;
+ bool m_defCheckInOnSave;
+ bool m_defCheckOutOnAction;
+ bool m_useParadigmFile;
+ std::string m_nameParadigmFile;
+ ParadigmInformation m_paradigmInfo;
+ };
class ATL_NO_VTABLE CCoreXmlFile :
***************
*** 351,355 ****
void setPointer (XmlObject * obj, attrid_type attribId, XmlObject * pointed);
! void setPointer (VARIANT p);
void updateCollections ();
--- 406,410 ----
void setPointer (XmlObject * obj, attrid_type attribId, XmlObject * pointed);
! XmlObject * setPointer (VARIANT p);
void updateCollections ();
***************
*** 361,364 ****
--- 416,421 ----
void createSourceControlInfoRegNodes();
+ void createSourceControlStatRegNode(XmlObject * obj);
+
// getting connections
void getPointer (XmlAttrPointer * attr, VARIANT * p);
***************
*** 373,377 ****
void getCheckOutContainers (XmlObjSet& objects, XmlObjSet& containers);
! void getDependetContainers (XmlObject * obj, XmlObjSet& containers, XmlObjSet& processedObjects);
bool checkOutFiles (XmlObjSet& containers);
--- 430,434 ----
void getCheckOutContainers (XmlObjSet& objects, XmlObjSet& containers);
! void getDependentContainers (XmlObject * obj, XmlObjSet& containers, XmlObjSet& processedObjects);
bool checkOutFiles (XmlObjSet& containers);
***************
*** 397,400 ****
--- 454,461 ----
void writeObject (XmlObject * obj, FILE * file, bool container, const char * prefix, CTime lastWriteTime );
+ void applyLastWrTime (XmlObject * obj, bool container, CTime lastWriteTime );
+
+ void timeSync (const char * fileName, XmlObject * container);
+
bool moveContainerToDisk (XmlObject * container);
***************
*** 457,462 ****
--- 518,527 ----
void setSourceControlInfo ( XmlObject * container, const char * scInfo );
+ void set2SourceControlNodes ( XmlObject * container, const char * scInfo, const char * scStat);
+
void getSourceControlInfo ( XmlObject * container, std::string& scInfo );
+ void getSourceControlStat ( XmlObject * container, std::string& scInfo );
+
void updateSourceControlInfo( XmlObject * container );
***************
*** 465,469 ****
void dumpSourceControlInfo ();
! bool filesModifedByOthers ();
protected:
--- 530,549 ----
void dumpSourceControlInfo ();
! bool filesModifiedByOthers ();
!
! typedef std::pair<bool, bool> BOOLPAIR;
! BOOLPAIR filesModifiedByOthersV2( XmlObjSet& readOnlyFiles );
!
! bool fileModifiedByOthers ( XmlObject * obj );
!
! void decidePointerOperationTrivials();
!
! bool portlessModel ( XmlObject * obj);
!
! bool fcoInFolder ( XmlObject * obj);
!
! public:
! // this can be used by other classes too
! void sendMsg ( const std::string&, int mtype );
protected:
***************
*** 514,517 ****
--- 594,603 ----
XmlObject * m_openedObject;
XmlObject * m_root;
+ bool m_trivialChanges;
+
+ #ifdef _DEBUG
+ std::string mylog;
+ std::vector< std::pair<int,int> > m_relsChanged;
+ #endif
// transaction handling
***************
*** 521,525 ****
--- 607,615 ----
XmlObjSet m_deletedObjects;
//XmlObjSet m_checkOutContainers;
+
+
+ OperatingOptions m_userOpts;
};
+
#endif//MGA_COREXMLFILE_H
More information about the GME-commit
mailing list