1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0023483: Use appropriate type for handling integer time

Introduced new cdl-friendly Standard_Time alias to time_t type.
This commit is contained in:
omy 2013-01-24 11:27:45 +04:00 committed by abv
parent 5edb1ac35b
commit 6c3e4c2965
12 changed files with 90 additions and 16 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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 <Standard_Time.hxx>
#include <Standard_ConstructionError.hxx>
const Handle_Standard_Type& Standard_Time_Type_()
{
static Handle_Standard_Type _aType =
new Standard_Type ("Standard_Time", sizeof(Standard_Time), 0, NULL);
return _aType;
}

View File

@ -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 <Standard_TypeDef.hxx>
#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

View File

@ -21,6 +21,7 @@
#define _Standard_TypeDef_HeaderFile
#include <stddef.h>
#include <ctime>
#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

View File

@ -105,7 +105,7 @@ is
fields
thefilename : HAsciiString from TCollection;
thetime : Integer;
thetime : Time from Standard;
thesequenceoftokens : TokensSequence from Units;
end Lexicon;

View File

@ -111,7 +111,7 @@ is
fields
thefilename : HAsciiString from TCollection;
thetime : Integer;
thetime : Time from Standard;
thequantitiessequence : QuantitiesSequence from Units;
end UnitsDictionary;

View File

@ -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();

View File

@ -85,6 +85,6 @@ is
fields
thefilename : HAsciiString from TCollection;
thetime : Integer;
thetime : Time from Standard;
end UnitsLexicon;