diff --git a/src/Dynamic/Dynamic_FuzzyDefinitionsDictionary.cdl b/src/Dynamic/Dynamic_FuzzyDefinitionsDictionary.cdl index 8d3ebf144e..1507c9932a 100755 --- a/src/Dynamic/Dynamic_FuzzyDefinitionsDictionary.cdl +++ b/src/Dynamic/Dynamic_FuzzyDefinitionsDictionary.cdl @@ -128,7 +128,7 @@ is fields thefilename : HAsciiString from TCollection; - thetime : Integer from Standard ; - thesequenceoffuzzydefinitions : SequenceOfFuzzyDefinitions from Dynamic ; + thetime : Time from Standard; + thesequenceoffuzzydefinitions : SequenceOfFuzzyDefinitions from Dynamic; end FuzzyDefinitionsDictionary; diff --git a/src/Dynamic/Dynamic_MethodDefinitionsDictionary.cdl b/src/Dynamic/Dynamic_MethodDefinitionsDictionary.cdl index a5e9f61eb4..ef79cc3ad6 100755 --- a/src/Dynamic/Dynamic_MethodDefinitionsDictionary.cdl +++ b/src/Dynamic/Dynamic_MethodDefinitionsDictionary.cdl @@ -136,7 +136,7 @@ is fields thefilename : HAsciiString from TCollection; - thetime : Integer from Standard ; - thesequenceofmethoddefinitions : SequenceOfMethodDefinitions from Dynamic ; + thetime : Time from Standard; + thesequenceofmethoddefinitions : SequenceOfMethodDefinitions from Dynamic; end MethodDefinitionsDictionary; diff --git a/src/Materials/Materials_MaterialsDictionary.cdl b/src/Materials/Materials_MaterialsDictionary.cdl index 4b015d039a..ff76058593 100755 --- a/src/Materials/Materials_MaterialsDictionary.cdl +++ b/src/Materials/Materials_MaterialsDictionary.cdl @@ -29,7 +29,7 @@ inherits Transient uses - OStream from Standard, + OStream from Standard, HAsciiString from TCollection, MaterialsSequence from Materials, Material from Materials @@ -85,7 +85,7 @@ is fields thefilename : HAsciiString from TCollection; - thetime : Integer from Standard; + thetime : Time from Standard; thematerialssequence : MaterialsSequence from Materials; end MaterialsDictionary; diff --git a/src/Standard/FILES b/src/Standard/FILES index e72a0ce7ae..39b374a7ff 100755 --- a/src/Standard/FILES +++ b/src/Standard/FILES @@ -49,6 +49,8 @@ Standard_ShortReal.cxx Standard_ShortReal.hxx Standard_Stream.hxx Standard_String.hxx +Standard_Time.cxx +Standard_Time.hxx Standard_Transient.hxx Standard_Transient_proto.hxx Standard_TypeDef.hxx diff --git a/src/Standard/Standard.cdl b/src/Standard/Standard.cdl index f2ce3883d2..ac188ddaa7 100755 --- a/src/Standard/Standard.cdl +++ b/src/Standard/Standard.cdl @@ -73,15 +73,15 @@ is class AncestorIterator; deferred class Storable ; - primitive Boolean inherits Storable; - primitive Character inherits Storable; + primitive Boolean inherits Storable; + primitive Character inherits Storable; primitive ExtCharacter inherits Storable; primitive Integer inherits Storable; - primitive Byte inherits Storable; + primitive Byte inherits Storable; primitive Real inherits Storable; primitive ShortReal inherits Storable; - - primitive OId inherits Storable; + primitive Time inherits Storable; + primitive OId inherits Storable; deferred class Persistent ; -- inherits Storable class GUID; -- inherits Storable diff --git a/src/Standard/Standard_Time.cxx b/src/Standard/Standard_Time.cxx new file mode 100644 index 0000000000..f125d3edc3 --- /dev/null +++ b/src/Standard/Standard_Time.cxx @@ -0,0 +1,27 @@ +// Copyright (c) 2013 OPEN CASCADE SAS +// +// The content of this file is subject to the Open CASCADE Technology Public +// License Version 6.5 (the "License"). You may not use the content of this file +// except in compliance with the License. Please obtain a copy of the License +// at http://www.opencascade.org and read it completely before using this file. +// +// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its +// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. +// +// The Original Code and all software distributed under the License is +// distributed on an "AS IS" basis, without warranty of any kind, and the +// Initial Developer hereby disclaims all such warranties, including without +// limitation, any warranties of merchantability, fitness for a particular +// purpose or non-infringement. Please see the License for the specific terms +// and conditions governing the rights and limitations under the License. + +#include +#include + +const Handle_Standard_Type& Standard_Time_Type_() +{ + static Handle_Standard_Type _aType = + new Standard_Type ("Standard_Time", sizeof(Standard_Time), 0, NULL); + + return _aType; +} diff --git a/src/Standard/Standard_Time.hxx b/src/Standard/Standard_Time.hxx new file mode 100644 index 0000000000..fbf5fe69f4 --- /dev/null +++ b/src/Standard/Standard_Time.hxx @@ -0,0 +1,43 @@ +// Copyright (c) 2013 OPEN CASCADE SAS +// +// The content of this file is subject to the Open CASCADE Technology Public +// License Version 6.5 (the "License"). You may not use the content of this file +// except in compliance with the License. Please obtain a copy of the License +// at http://www.opencascade.org and read it completely before using this file. +// +// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its +// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. +// +// The Original Code and all software distributed under the License is +// distributed on an "AS IS" basis, without warranty of any kind, and the +// Initial Developer hereby disclaims all such warranties, including without +// limitation, any warranties of merchantability, fitness for a particular +// purpose or non-infringement. Please see the License for the specific terms +// and conditions governing the rights and limitations under the License. + +#ifndef _Standard_Time_HeaderFile +#define _Standard_Time_HeaderFile + +#ifndef _Standard_TypeDef_HeaderFile +#include +#endif + +class Handle_Standard_Type; + +__Standard_API const Handle_Standard_Type& Standard_Time_Type_(); + +// =============================================== +// Methods from Standard_Entity class which are redefined: +// - IsEqual +// =============================================== + +// ------------------------------------------------------------------ +// IsEqual : Returns Standard_True if two time values are equal +// ------------------------------------------------------------------ +inline Standard_Boolean IsEqual (const Standard_Time theOne, + const Standard_Time theTwo) +{ + return theOne == theTwo; +} + +#endif diff --git a/src/Standard/Standard_TypeDef.hxx b/src/Standard/Standard_TypeDef.hxx index 3921840994..44bad4cf9d 100755 --- a/src/Standard/Standard_TypeDef.hxx +++ b/src/Standard/Standard_TypeDef.hxx @@ -21,6 +21,7 @@ #define _Standard_TypeDef_HeaderFile #include +#include #define Standard_False (Standard_Boolean)0 #define Standard_True (Standard_Boolean)1 @@ -42,5 +43,6 @@ typedef size_t Standard_Size; typedef const char* Standard_CString; typedef const short* Standard_ExtString; -#endif +typedef std::time_t Standard_Time; +#endif diff --git a/src/Units/Units_Lexicon.cdl b/src/Units/Units_Lexicon.cdl index 6153f65f73..8f5129c969 100755 --- a/src/Units/Units_Lexicon.cdl +++ b/src/Units/Units_Lexicon.cdl @@ -105,7 +105,7 @@ is fields thefilename : HAsciiString from TCollection; - thetime : Integer; + thetime : Time from Standard; thesequenceoftokens : TokensSequence from Units; end Lexicon; diff --git a/src/Units/Units_UnitsDictionary.cdl b/src/Units/Units_UnitsDictionary.cdl index 1e9419e507..28151fa5b5 100755 --- a/src/Units/Units_UnitsDictionary.cdl +++ b/src/Units/Units_UnitsDictionary.cdl @@ -111,7 +111,7 @@ is fields thefilename : HAsciiString from TCollection; - thetime : Integer; + thetime : Time from Standard; thequantitiessequence : QuantitiesSequence from Units; end UnitsDictionary; diff --git a/src/Units/Units_UnitsDictionary.cxx b/src/Units/Units_UnitsDictionary.cxx index ccd77446ec..53c2e0d7e8 100755 --- a/src/Units/Units_UnitsDictionary.cxx +++ b/src/Units/Units_UnitsDictionary.cxx @@ -110,7 +110,7 @@ void Units_UnitsDictionary::Creates(const Standard_CString afilename) thefilename = new TCollection_HAsciiString(afilename); struct stat buf; - if(!stat(afilename,&buf)) thetime = (Standard_Integer)buf.st_ctime; + if(!stat(afilename,&buf)) thetime = buf.st_ctime; thequantitiessequence = new Units_QuantitiesSequence(); diff --git a/src/Units/Units_UnitsLexicon.cdl b/src/Units/Units_UnitsLexicon.cdl index 751d663378..4147efe6a0 100755 --- a/src/Units/Units_UnitsLexicon.cdl +++ b/src/Units/Units_UnitsLexicon.cdl @@ -85,6 +85,6 @@ is fields thefilename : HAsciiString from TCollection; - thetime : Integer; + thetime : Time from Standard; end UnitsLexicon;