#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
+#ifndef _Standard_DefineAlloc_HeaderFile
+#include <Standard_DefineAlloc.hxx>
+#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
{
public:
- void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
+ DEFINE_STANDARD_ALLOC
//! create empty tool <br>
Standard_EXPORT BRepExtrema_DistShapeShape();
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
+#ifndef _Standard_DefineAlloc_HeaderFile
+#include <Standard_DefineAlloc.hxx>
+#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
{
public:
- void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
+ DEFINE_STANDARD_ALLOC
//! computes the distance between two Shapes ( face edge vertex). <br>
Standard_EXPORT BRepExtrema_DistanceSS(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
+#ifndef _Standard_DefineAlloc_HeaderFile
+#include <Standard_DefineAlloc.hxx>
+#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
{
public:
- void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
+ DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepExtrema_ExtCC()
{
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
+#ifndef _Standard_DefineAlloc_HeaderFile
+#include <Standard_DefineAlloc.hxx>
+#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
{
public:
- void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
+ DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepExtrema_ExtCF()
{
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
+#ifndef _Standard_DefineAlloc_HeaderFile
+#include <Standard_DefineAlloc.hxx>
+#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
{
public:
- void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
-
+ DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepExtrema_ExtFF()
{
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
+#ifndef _Standard_DefineAlloc_HeaderFile
+#include <Standard_DefineAlloc.hxx>
+#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
{
public:
- void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
-
+ DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepExtrema_ExtPC()
{
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
+#ifndef _Standard_DefineAlloc_HeaderFile
+#include <Standard_DefineAlloc.hxx>
+#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
{
public:
- void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
+ DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepExtrema_ExtPF()
{}
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
+#ifndef _Standard_DefineAlloc_HeaderFile
+#include <Standard_DefineAlloc.hxx>
+#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
{
public:
- void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
+ DEFINE_STANDARD_ALLOC
-
Standard_EXPORT BRepExtrema_SolutionElem()
: myDist(0.), myPoint(0.,0.,0.), mySupType(BRepExtrema_IsVertex), myPar1(0.), myPar2(0.)
{
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
+#ifndef _Standard_DefineAlloc_HeaderFile
+#include <Standard_DefineAlloc.hxx>
+#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
public:
- void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
+ DEFINE_STANDARD_ALLOC
+
// Methods PUBLIC
//
Standard_EXPORT virtual void Delete() ;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
+#ifndef _Standard_DefineAlloc_HeaderFile
+#include <Standard_DefineAlloc.hxx>
+#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
public:
- void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
+ DEFINE_STANDARD_ALLOC
+
// Methods PUBLIC
//
Standard_EXPORT virtual void Delete() ;
if(Size > 0) {
#endif
#ifdef CSFDB
- myData = (DBC_VArrayTNode*)StandardCSFDB_Allocate(Size * sizeof(DBC_VArrayTNode));
+ myData = (DBC_VArrayTNode*)Standard::Allocate(Size * sizeof(DBC_VArrayTNode));
DBC_VArrayTNode* ptrtmp = (DBC_VArrayTNode*)myData;
for (int i = 0; i < Size; i++) {
ptrtmp = new((Standard_Address)ptrtmp) DBC_VArrayTNode();
#ifdef CSFDB
//myData = new DBC_VArrayTNode[mySize];
- myData = (DBC_VArrayTNode*)StandardCSFDB_Allocate(mySize * sizeof(DBC_VArrayTNode));
+ myData = (DBC_VArrayTNode*)Standard::Allocate(mySize * sizeof(DBC_VArrayTNode));
DBC_VArrayTNode* ptrtmp = (DBC_VArrayTNode*)myData;
for(Standard_Integer i=0; i<mySize; i++) {
DBC_VArrayTNode* ptr = 0L;
if(NewSize) {
- ptr = (DBC_VArrayTNode*)StandardCSFDB_Allocate(NewSize * sizeof(DBC_VArrayTNode));
+ ptr = (DBC_VArrayTNode*)Standard::Allocate(NewSize * sizeof(DBC_VArrayTNode));
}
DBC_VArrayTNode* ptrtmp = ptr;
ptrtmp->DBC_VArrayTNode::~DBC_VArrayTNode();
ptrtmp++;
}
-// StandardCSFDB_Free((Standard_Address&)myData,mySize * sizeof(DBC_VArrayTNode));
- StandardCSFDB_Free((Standard_Address&)myData);
+ Standard::Free((Standard_Address&)myData);
} else {
for(i = 0; i < NewSize; i++) {
ptrtmp = new((Standard_Address)ptrtmp) DBC_VArrayTNode();
ptrtmp->DBC_VArrayTNode::~DBC_VArrayTNode();
ptrtmp++;
}
-// StandardCSFDB_Free((Standard_Address&)myData,mySize * sizeof(DBC_VArrayTNode));
- StandardCSFDB_Free((Standard_Address&)myData);
+ Standard::Free((Standard_Address&)myData);
myData = 0L;
}
#endif
{
int mode;
float skipRatio;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
typedef _degeneration DEGENERATION;
typedef _degeneration* PDEGENERATION;
int model;
float skipRatio;
unsigned char* bDraw;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
typedef _ds_internal DS_INTERNAL;
typedef _ds_internal* PDS_INTERNAL;
#define INTERFACEGRAPHIC_TELEM_H
#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
#include <InterfaceGraphic_tgl_all.hxx>
#include <stdlib.h>
-//if SUN compiler
-#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530) && ! defined(typename)
-#define IMPLEMENT_MEMORY_OPERATORS \
- void* operator new (size_t size) {\
- void* p = malloc( size );\
- memset(p, 0, size);\
- return p;\
- }\
- void operator delete(void* p) {\
- free( p );\
- }
-#else
-//if other
-#define IMPLEMENT_MEMORY_OPERATORS \
- void* operator new (size_t size) {\
- void* p = malloc( size );\
- memset(p, 0, size);\
- return p;\
- }\
- void* operator new[] (size_t size) {\
- void* p = malloc( size );\
- memset(p, 0, size);\
- return p;\
- }\
- void operator delete(void* p) { \
- free( p );\
- }\
- void operator delete[](void* p) {\
- free( p );\
- }
-#endif
-
struct TEL_TEXTURE_COORD
{
float xy[2];
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
typedef TEL_TEXTURE_COORD* tel_texture_coord;
struct TEL_POINT
{
float xyz[3];
- IMPLEMENT_MEMORY_OPERATORS
- /*void* operator new (size_t size) {
- void* p = malloc( size );
- memset(p, 0, size);
- return p;
- }
- void* operator new[] (size_t size) {
- void* p = malloc( size );
- memset(p, 0, size);
- return p;
- }
- void operator delete(void* p) {
- free( p );
- }
- void operator delete[](void* p) {
- free( p );
- }*/
+ DEFINE_STANDARD_ALLOC
};
typedef TEL_POINT* tel_point;
{
/* OCC8854: san -- number of color components increased to include alpha value */
float rgb[4];
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
typedef TEL_COLOUR* tel_colour;
{
int num;
TEL_POINT* data;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
typedef TEL_POINT_DATA* tel_point_data;
{
int num;
int* data;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
typedef TEL_TINT_DATA* tel_tint_data;
{
TComposeType mode;
Tmatrix3 mat;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
typedef TEL_MATRIX3_DATA* tel_matrix3_data;
{
Tint Hmode;
Tint Vmode;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
typedef TEL_ALIGN_DATA* tel_align_data;
int isamb, isdiff, isspec, isemsv;
int isphysic;
TEL_COLOUR speccol, difcol, ambcol, emscol, matcol;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
typedef TEL_SURF_PROP* tel_surf_prop;
int mode;
float factor;
float units;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
typedef TEL_POFFSET_PARAM* tel_poffset_param;
/* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */
float pointX;
float pointY;
float pointZ;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
typedef TEL_TRANSFORM_PERSISTENCE* tel_transform_persistence;
/* ABD 29/10/04 Transform Persistence of Presentation( pan, zoom, rotate ) */
#include <LDOM_BasicAttribute.hxx>
#include <LDOM_MemManager.hxx>
-#ifdef WNT
-// Disable the warning: "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
//=======================================================================
//function : LDOM_BasicAttribute
//purpose :
class LDOM_Attr;
class LDOM_Node;
-#ifdef WNT
-// Disable the warning: "operator new unmatched by delete"
-#pragma warning (push)
-#pragma warning (disable:4291)
-#endif
-
// Class LDOM_BasicAttribute
//
class LDOM_BasicAttribute : public LDOM_BasicNode
{
public:
- void * operator new (size_t, void * anAddress) { return anAddress; }
-
// ---------- PUBLIC METHODS ----------
LDOM_BasicAttribute () : LDOM_BasicNode (LDOM_Node::UNKNOWN) {}
LDOMBasicString myValue;
};
-#ifdef WNT
-#pragma warning (pop)
-#endif
-
#endif
#include <LDOM_BasicText.hxx>
#include <LDOM_MemManager.hxx>
-#ifdef WNT
-// Disable the warning: "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
//=======================================================================
//function : Create
//purpose : construction in the Document's data pool
class LDOM_Element;
class LDOM_BasicAttribute;
-#ifdef WNT
-// Disable the warning: "operator new unmatched by delete"
-#pragma warning (push)
-#pragma warning (disable:4291)
-#endif
-
// Class LDOM_BasicElement
//
class LDOM_BasicElement : public LDOM_BasicNode
{
public:
- void * operator new (size_t, void * anAddress) { return anAddress; }
// ---------- PUBLIC METHODS ----------
LDOM_BasicNode * myFirstChild;
};
-#ifdef WNT
-#pragma warning (pop)
-#endif
-
#endif
class LDOM_BasicNode
{
+ public:
+ DEFINE_STANDARD_ALLOC
+
public:
Standard_Boolean isNull () const {return myNodeType ==LDOM_Node::UNKNOWN;}
#include <LDOM_BasicText.hxx>
#include <LDOM_MemManager.hxx>
-#ifdef WNT
-// Disable the warning: "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
//=======================================================================
//function : LDOM_BasicText()
//purpose : Constructor
class LDOMParser;
class LDOM_BasicElement;
-#ifdef WNT
-// Disable the warning: "operator new unmatched by delete"
-#pragma warning (push)
-#pragma warning (disable:4291)
-#endif
-
// Class LDOM_BasicText
//
class LDOM_BasicText : public LDOM_BasicNode
{
public:
- void * operator new (size_t, void * anAddress) { return anAddress; }
// ---------- PUBLIC METHODS ----------
LDOMBasicString myValue;
};
-#ifdef WNT
-#pragma warning (pop)
-#endif
-
#endif
NCollection_QuickSort.hxx
NCollection_Haft.h
+NCollection_DefaultHasher.hxx
+NCollection_DefineAlloc.hxx
-
-NCollection_DefaultHasher.hxx
\ No newline at end of file
#include <NCollection_BaseCollection.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (push)
-#pragma warning (disable:4291)
-#endif
-
// *********************************************** Template for Array1 class
/**
//! Variable value access
virtual TheItemType& ChangeValue (void) const
{ return myArray->ChangeValue(myCurrent); }
- //! Operator new for allocating iterators
- void* operator new(size_t theSize,
- const Handle(NCollection_BaseAllocator)& theAllocator)
- { return theAllocator->Allocate(theSize); }
private:
Standard_Integer myCurrent; //!< Index of the current item
NCollection_Array1* myArray; //!< Pointer to the array being iterated
TheItemType* myData; //!< Pointer to '0'th array item
};
-#ifdef WNT
-#pragma warning (pop)
-#endif
-
#endif
#include <NCollection_BaseCollection.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
// *********************************************** Template for Array2 class
/**
* Purpose: The class Array2 represents bi-dimensional arrays
//! Variable value access
virtual TheItemType& ChangeValue (void) const
{ return myArray->myStart[myCurrent]; }
- //! Operator new for allocating iterators
- void* operator new(size_t theSize,
- const Handle(NCollection_BaseAllocator)& theAllocator)
- { return theAllocator->Allocate(theSize); }
private:
Standard_Integer myCurrent; //!< Index of the current item
Standard_Integer mySize; //!< Total amount of items
};
-#ifdef WNT
-#pragma warning (default:4291)
-#endif
-
#endif
#define NCollection_BaseCollection_HeaderFile
#include <NCollection_IncAllocator.hxx>
+#include <NCollection_DefineAlloc.hxx>
/**
* Purpose: NCollection_BaseCollection is the base abstract class for
virtual const TheItemType& Value(void) const=0;
//! Value change access
virtual TheItemType& ChangeValue(void) const=0;
+ public:
+ DEFINE_STANDARD_ALLOC
+ DEFINE_NCOLLECTION_ALLOC
protected:
//! Empty constructor
Iterator (void) {}
#include <Standard_NoSuchObject.hxx>
#include <NCollection_ListNode.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
typedef void (* NCollection_DelListNode)
(NCollection_ListNode*, Handle(NCollection_BaseAllocator)& theAl);
#include <NCollection_BaseAllocator.hxx>
#include <NCollection_ListNode.hxx>
-//#ifdef WNT
-//// Disable the warning "operator new unmatched by delete"
-//#pragma warning (disable:4291)
-//#endif
-
typedef void (* NCollection_DelMapNode)
(NCollection_ListNode*, Handle(NCollection_BaseAllocator)& theAl);
#include <NCollection_Map.hxx>
#include <NCollection_DataMap.hxx>
#include <NCollection_BaseAllocator.hxx>
-
-// work-around for obsolete SUN WorkShop 5.3 compiler
-// which does not recognize typename keyword
-#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530) && ! defined(typename)
-#define typename
-#endif
+#include <NCollection_TypeDef.hxx>
//! Auxiliary enumeration serving as responce from method Inspect
enum NCollection_CellFilter_Action
class NCollection_CellFilter
{
public:
- typedef typename Inspector::Target Target;
- typedef typename Inspector::Point Point;
+ typedef TYPENAME Inspector::Target Target;
+ typedef TYPENAME Inspector::Point Point;
public:
#include <Standard_TypeMismatch.hxx>
#include <Standard_NoSuchObject.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (push)
-#pragma warning (disable:4291)
-#endif
-
/**
* Purpose: The DataMap is a Map to store keys with associated
* Items. See Map from NCollection for a discussion
#endif
return ((DataMapNode *) myNode)->Key();
}
- //! Operator new for allocating iterators
- void* operator new(size_t theSize,
- const Handle(NCollection_BaseAllocator)& theAllocator)
- { return theAllocator->Allocate(theSize); }
};
public:
};
-#ifdef WNT
-#pragma warning (pop)
-#endif
-
#endif
--- /dev/null
+// File: Standard_DefineAlloc.hxx
+// Created: Jan 19 14:15:16 2012
+// Author: Dmitry BOBYLEV
+// Copyright: Open CASCADE SAS 2012
+
+#ifndef _NCollection_DefineAlloc_HeaderFile
+# define _NCollection_DefineAlloc_HeaderFile
+
+// Macro to overload placement new and delete operators for NCollection allocators.
+// For Borland C and old SUN compilers do not define placement delete
+// as it is not supported.
+# if defined(__BORLANDC__) || (defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530))
+# define DEFINE_NCOLLECTION_ALLOC \
+ void* operator new (size_t theSize, \
+ const Handle(NCollection_BaseAllocator)& theAllocator) \
+ { \
+ return theAllocator->Allocate(theSize); \
+ }
+# else
+# define DEFINE_NCOLLECTION_ALLOC \
+ void* operator new (size_t theSize, \
+ const Handle(NCollection_BaseAllocator)& theAllocator) \
+ { \
+ return theAllocator->Allocate(theSize); \
+ } \
+ void operator delete (void* theAddress, \
+ const Handle(NCollection_BaseAllocator)& theAllocator) \
+ { \
+ theAllocator->Free(theAddress); \
+ }
+# endif
+
+#endif
\ No newline at end of file
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_Array1.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
// *********************************************** Template for Array1 class
#define DEFINE_ARRAY1(_ClassName_, _BaseCollection_, TheItemType) \
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_Array2.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
// *********************************************** Template for Array2 class
#define DEFINE_ARRAY2(_ClassName_, _BaseCollection_, TheItemType) \
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_DataMap.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
// *********************************************** Class DataMap *************
#define DEFINE_DATAMAP(_ClassName_, _BaseCollection_, TheKeyType, TheItemType) \
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_DoubleMap.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
// *********************************************** Class DoubleMap ************
#define DEFINE_DOUBLEMAP(_ClassName_, _BaseCollection_, TheKey1Type, TheKey2Type) \
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_IndexedDataMap.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
// *********************************************** Class IndexedDataMap ******
#define DEFINE_INDEXEDDATAMAP(_ClassName_, _BaseCollection_, TheKeyType, TheItemType) \
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_IndexedMap.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
// *********************************************** Class IndexedMap ***********
#define DEFINE_INDEXEDMAP(_ClassName_, _BaseCollection_, TheKeyType) \
#include <NCollection_List.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
// **************************************** Template for List class ********
#define DEFINE_LIST(_ClassName_, _BaseCollection_, TheItemType) \
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_Map.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
// *********************************************** Class Map *****************
#define DEFINE_MAP(_ClassName_, _BaseCollection_, TheKeyType) \
#include <NCollection_Queue.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
// **************************************** Template for Queue class ********
#define DEFINE_QUEUE(_ClassName_, _BaseCollection_, TheItemType) \
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_SList.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
// **************************************** Template for SList class ********
#define DEFINE_SLIST(_ClassName_, _BaseCollection_, TheItemType) \
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_Sequence.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
// **************************************** Template for Sequence class ********
#define DEFINE_SEQUENCE(_ClassName_, _BaseCollection_, TheItemType) \
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_Set.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
// **************************************** Template for Set class ********
#define DEFINE_SET(_ClassName_, _BaseCollection_, TheItemType) \
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_Stack.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
// **************************************** Template for Stack class ********
#define DEFINE_STACK(_ClassName_, _BaseCollection_, TheItemType) \
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_TListIterator.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
// ********************************** Implementation of the Iterator interface
#define DEFINE_TLISTITERATOR(_ClassName_, _BaseCollection_, TheItemType) \
typedef NCollection_TListIterator<TheItemType > _ClassName_;
#include <NCollection_TListNode.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
// ******************************* Class defining list node - for internal use
#define DEFINE_TLISTNODE(_ClassName_, _BaseCollection_, TheItemType) \
typedef NCollection_TListNode<TheItemType > _ClassName_;
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_Vector.hxx>
-#ifdef WNT
-// Disable the warning: "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
// Class NCollection_Vector (dynamic array of objects)
//
// This class is similar to NCollection_Array1 though the indices always start
#include <NCollection_DefaultHasher.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (push)
-#pragma warning (disable:4291)
-#endif
-
/**
* Purpose: The DoubleMap is used to bind pairs (Key1,Key2)
* and retrieve them in linear time.
Standard_ImmutableObject::Raise("NCollection_DoubleMap::Iterator::ChangeValue");
return * (TheKey2Type *) NULL; // For compiler
}
- //! Operator new for allocating iterators
- void* operator new(size_t theSize,
- const Handle(NCollection_BaseAllocator)& theAllocator)
- { return theAllocator->Allocate(theSize); }
};
public:
};
-#ifdef WNT
-#pragma warning (pop)
-#endif
-
#endif
#include <Standard_OutOfRange.hxx>
#endif
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (push)
-#pragma warning (disable:4291)
-#endif
-
/**
* Purpose: An indexed map is used to store keys and to bind
* an index to them. Each new key stored in the map
#endif
return myMap->ChangeFromIndex(myIndex);
}
- //! Operator new for allocating iterators
- void* operator new(size_t theSize,
- const Handle(NCollection_BaseAllocator)& theAllocator)
- { return theAllocator->Allocate(theSize); }
private:
NCollection_IndexedDataMap * myMap; //!< Pointer to the map being iterated
};
-#ifdef WNT
-#pragma warning (pop)
-#endif
-
#endif
#include <Standard_OutOfRange.hxx>
#endif
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (push)
-#pragma warning (disable:4291)
-#endif
-
/**
* Purpose: An indexed map is used to store keys and to bind
* an index to them. Each new key stored in the map
return * (TheKeyType *) NULL; // This for compiler
}
- //! Operator new for allocating iterators
- void* operator new(size_t theSize,
- const Handle(NCollection_BaseAllocator)& theAllocator)
- { return theAllocator->Allocate(theSize); }
-
private:
NCollection_IndexedMap * myMap; // Pointer to the map being iterated
Standard_Integer myIndex; // Current index
};
-#ifdef WNT
-#pragma warning (pop)
-#endif
-
#endif
#include <Standard_NoSuchObject.hxx>
#endif
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (push)
-#pragma warning (disable:4291)
-#endif
-
/**
* Purpose: Simple list to link items together keeping the first
* and the last one.
}
};
-#ifdef WNT
-#pragma warning (pop)
-#endif
-
#endif
#include <NCollection_BaseAllocator.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
/**
* Purpose: This class is used to represent a node in the BaseList and
* BaseMap.
#include <Standard_NoSuchObject.hxx>
#endif
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (push)
-#pragma warning (disable:4291)
-#endif
-
/**
* Purpose: Single hashed Map. This Map is used to store and
* retrieve keys in linear time.
#endif
return ((MapNode *) myNode)->Value();
}
- //! Operator new for allocating iterators
- void* operator new(size_t theSize,
- const Handle(NCollection_BaseAllocator)& theAllocator)
- { return theAllocator->Allocate(theSize); }
};
public:
};
-#ifdef WNT
-#pragma warning (pop)
-#endif
-
#endif
#include <Standard_NoSuchObject.hxx>
#endif
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
/**
* Purpose: A queue is a structure where Items are added at
* the end and removed from the front. The first
};
-#ifdef WNT
-#pragma warning (default:4291)
-#endif
-
#endif
#include <Standard_NoSuchObject.hxx>
#endif
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
/**
* Purpose: An SList is a LISP like list of Items.
* An SList is :
myTail->Clear();
myTail->myAllocator->Free(myTail);
}
- //! Operator new for allocating nodes
- void* operator new(size_t theSize,
- const Handle(NCollection_BaseAllocator)& theAllocator)
- { return theAllocator->Allocate(theSize); }
- //! news to avoid warnings on hiding - not for use
- void* operator new(size_t theSize)
- { return Standard::Allocate(theSize); }
- void* operator new(size_t /*theSize*/, void* theAddress)
- { return theAddress; }
+
+ DEFINE_STANDARD_ALLOC
+ DEFINE_NCOLLECTION_ALLOC
+
private:
// ---------- PRIVATE FIELDS ------------
Standard_Integer myCount; //!< Reference count
myNode->myCount++;
}
- //! Operator new for creating 'iterator'
- void* operator new(size_t theSize,
- const Handle(NCollection_BaseAllocator)& theAllocator)
- { return theAllocator->Allocate(theSize); }
-
//! Clear the items out
void Clear (void)
{
friend class SListNode;
};
-#ifdef WNT
-#pragma warning (default:4291)
-#endif
-
#endif
#include <Standard_NoSuchObject.hxx>
#endif
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (push)
-#pragma warning (disable:4291)
-#endif
-
/**
* Purpose: Definition of a sequence of elements indexed by
* an Integer in range of 1..n
//! Variable value access
TheItemType& ChangeValue () { return myValue; }
//! Memory allocation
- void* operator new(size_t theSize,
- const Handle(NCollection_BaseAllocator)& theAllocator)
- { return theAllocator->Allocate(theSize); }
+ DEFINE_STANDARD_ALLOC
+ DEFINE_NCOLLECTION_ALLOC
private:
TheItemType myValue;
//! Variable value access
virtual TheItemType& ChangeValue (void) const
{ return ((Node *)myCurrent)->ChangeValue(); }
- //! Operator new for allocating iterators
- void* operator new(size_t theSize,
- const Handle(NCollection_BaseAllocator)& theAllocator)
- { return theAllocator->Allocate(theSize); }
}; // End of nested class Iterator
public:
};
-#ifdef WNT
-#pragma warning (pop)
-#endif
-
#endif
#include <NCollection_TListNode.hxx>
#include <NCollection_TListIterator.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
/**
* Purpose: A set is an unordered collection of items without
* duplications. To test for duplications the operators == and !=
};
-#ifdef WNT
-#pragma warning (default:4291)
-#endif
-
#endif
#include <NCollection_SparseArrayBase.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (push)
-#pragma warning (disable:4291)
-#endif
-
/**
* Dynamically resizable sparse array of objects
*
};
-#ifdef WNT
-#pragma warning (pop)
-#endif
-
#endif
#include <Standard_NoSuchObject.hxx>
#endif
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
/**
* Purpose: A stack is a structure where item can be added and
* removed from the top. Like a stack of plates in a
};
-#ifdef WNT
-#pragma warning (default:4291)
-#endif
-
#endif
#include <NCollection_BaseList.hxx>
#include <NCollection_TListNode.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (push)
-#pragma warning (disable:4291)
-#endif
-
/**
* Purpose: This Iterator class iterates on BaseList of TListNode and is
* instantiated in List/Set/Queue/Stack
//! Variable Value access
virtual TheItemType& ChangeValue (void) const
{ return ((NCollection_TListNode<TheItemType> *)myCurrent)->ChangeValue(); }
- //! Operator new for allocating iterators
- void* operator new(size_t theSize,
- const Handle(NCollection_BaseAllocator)& theAllocator)
- { return theAllocator->Allocate(theSize); }
};
-#ifdef WNT
-#pragma warning (pop)
-#endif
-
#endif
#include <NCollection_ListNode.hxx>
#include <NCollection_BaseAllocator.hxx>
-
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (push)
-#pragma warning (disable:4291)
-#endif
+#include <NCollection_DefineAlloc.hxx>
/**
* Purpose: Abstract list node class. Used by BaseList
//! Variable value access
TheItemType& ChangeValue () { return myValue; }
//! Memory allocation
- void* operator new(size_t theSize,
- const Handle(NCollection_BaseAllocator)& theAllocator)
- { return theAllocator->Allocate(theSize); }
+ DEFINE_STANDARD_ALLOC
+ DEFINE_NCOLLECTION_ALLOC
//! Static deleter to be passed to BaseList
static void delNode (NCollection_ListNode * theNode,
Handle(NCollection_BaseAllocator)& theAl)
};
-#ifdef WNT
-#pragma warning (pop)
-#endif
-
#endif
#define NCollection_UBTree_HeaderFile
#include <NCollection_BaseAllocator.hxx>
-
-#ifdef WNT
-// Disable the warning: "operator new unmatched by delete"
-#pragma warning (push)
-#pragma warning (disable:4291)
-#endif
+#include <NCollection_DefineAlloc.hxx>
/**
* The algorithm of unbalanced binary tree of overlapped bounding boxes.
*/
class TreeNode
{
+ public:
+ DEFINE_STANDARD_ALLOC
+ DEFINE_NCOLLECTION_ALLOC
+
public:
TreeNode (const TheObjType& theObj, const TheBndType& theBnd)
: myBnd(theBnd), myObject(theObj), myChildren(0), myParent(0) {}
// ~TreeNode () { if (myChildren) delete [] myChildren; }
~TreeNode () { myChildren = 0L; }
- /**
- * Allocator of a tree node.
- */
- void * operator new (size_t theSize,
- const Handle(NCollection_BaseAllocator)& theAllocator)
- { return theAllocator->Allocate(theSize); }
-
- /**
- * Allocator of a tree node.
- */
- void * operator new (size_t,
- void * theMem)
- { return theMem; }
-
/**
* Deleter of tree node. The whole hierarchy of its children also deleted.
* This method should be used instead of operator delete.
IMPLEMENT_STANDARD_HANDLE (_HUBTREE, _HPARENT) \
IMPLEMENT_STANDARD_RTTIEXT(_HUBTREE, _HPARENT)
-#ifdef WNT
-#pragma warning (pop)
-#endif
-
#endif
#include <Standard_OutOfRange.hxx>
#endif
-#ifdef WNT
-// Disable the warning: "operator new unmatched by delete"
-#pragma warning (push)
-#pragma warning (disable:4291)
-#endif
-
/**
* Class NCollection_Vector (dynamic array of objects)
*
//! Nested class MemBlock
class MemBlock : public NCollection_BaseVector::MemBlock
{
- public:
- void * operator new (size_t, void * theAddress) { return theAddress; }
+ public:
+ DEFINE_STANDARD_ALLOC
+
//! Empty constructor
MemBlock (NCollection_BaseAllocator* theAlloc)
: NCollection_BaseVector::MemBlock(0,0,theAlloc)
//! Variable value access
virtual TheItemType& ChangeValue (void) const {
return ((MemBlock *) CurBlockV()) -> ChangeValue(myCurIndex); }
- //! Operator new for allocating iterators
- void* operator new(size_t theSize,
- const Handle(NCollection_BaseAllocator)& theAllocator)
- { return theAllocator->Allocate(theSize); }
}; // End of the nested class Iterator
// ----------------------------------------------------------------------
friend class Iterator;
};
-#ifdef WNT
-#pragma warning (pop)
-#endif
-
#endif
#include <Bnd_B3f.hxx>
#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
#pragma warning (push)
+// Disable warning 4480: nonstandard extension used: specifying underlying type for enum 'enum'
#pragma warning (disable:4480)
#endif
#include <NIS_InteractiveObject.hxx>
#include <Quantity_Color.hxx>
-#ifdef WNT
-// Disable the warning "operator new unmatched by delete"
-#pragma warning (push)
-#pragma warning (disable:4291)
-#endif
-
class Handle_NIS_TriangulatedDrawer;
class NCollection_BaseAllocator;
class Handle_NCollection_BaseAllocator;
*/
Standard_EXPORT virtual void Delete () const;
- /**
- * Operator new for memory allocation uses Open CASCADE memory manager
- */
- void* operator new (size_t size)
- {
- return Standard::Allocate(size);
- }
-
protected:
/**
* Allocator-based operator new for dynamic allocations in method Clone()
*/
- void* operator new (Standard_Size theSz,
- const Handle(NCollection_BaseAllocator)& theAllocator)
- {
- return theAllocator->Allocate(theSz);
- }
+ DEFINE_STANDARD_ALLOC
+ DEFINE_NCOLLECTION_ALLOC
/**
* Create a 3D bounding box of the object.
// Definition of HANDLE object using Standard_DefineHandle.hxx
DEFINE_STANDARD_HANDLE (NIS_Triangulated, NIS_InteractiveObject)
-#ifdef WNT
-#pragma warning (pop)
-#endif
-
#endif
int isphysic;
unsigned int color_mask;
TEL_COLOUR speccol, difcol, ambcol, emscol, matcol;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
struct TEL_CONTEXT_FACE
int doTextureMap;
int TexId;
TEL_POFFSET_PARAM PolygonOffset;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#include <OpenGl_Element.hxx>
OpenGl_AspectLine myAspectEdge;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //_OpenGl_AspectFace_Header
float myWidth;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //_OpenGl_AspectLine_Header
float myScale;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_AspectMarker_Header
TEL_COLOUR mySubtitleColor;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_AspectText_Header
{
Handle_OpenGl_Workspace WS;
Handle_OpenGl_View View;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_CView_Header
unsigned int Width;
unsigned int Height;
unsigned char* Array;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
typedef NCollection_DataMap<int,OPENGL_MARKER_DATA> OpenGl_MapOfUserMarker;
Standard_Integer myFontSize;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
extern Handle(OpenGl_Display) openglDisplay;
virtual void Render (const Handle(OpenGl_Workspace) &AWorkspace) const = 0;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_Element_Header
void* myPtrVisual3dView;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //_OpenGl_GraduatedTrihedron_Header
TelType type;
OpenGl_Element *elem;
OpenGl_ElementNode *next;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
class OpenGl_Group : public OpenGl_Element
OpenGl_ElementNode *myFirst, *myLast;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //_OpenGl_Group_Header
Tfloat shine;
Tfloat atten[2];
Tfloat angle;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
typedef NCollection_List<OpenGl_Light> OpenGl_ListOfLight;
TEL_POINT myPoint;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_Marker_Header
TEL_POINT *myPoints;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_MarkerSet_Header
struct OpenGl_Matrix
{
float mat[4][4];
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
Standard_EXPORT void OpenGl_Multiplymat3 (OpenGl_Matrix *c, const OpenGl_Matrix *a, const OpenGl_Matrix *b);
tel_colour vcolours; /* Vertex colour values */
tel_point vnormals; /* Vertex normals */
tel_texture_coord vtexturecoord; /* Texture Coordinates */
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
class OpenGl_Mesh : public OpenGl_Element
DS_INTERNAL *myDS;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_Mesh_Header
{
GLfloat vert[3];
int ind;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
typedef EXTRA_VERTEX* extra_vertex;
Tint ts_num, ts_alloc;
void **tmesh_sequence;
GLenum triangle_type; /* FSXXX OPTI */
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
struct OPENGL_DISPLAY_PGN
Tint num_of_seq;
Tint num_alloc;
SEQ_ *seq;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
static void bgntriangulate( const TEL_POLYGON_DATA *, void (APIENTRY*)() );
tel_point vnormals; /* Vertex normals */
tel_texture_coord vtexturecoord; /* Texture Coordinates */
OPENGL_DISPLAY_PGN *dsply;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
class OpenGl_Polygon : public OpenGl_Element
TEL_POLYGON_DATA myData;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_Polygon_Header
tel_colour myColors; // Vertex color values for each vertex
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_Polyline_Header
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
Standard_Integer myNbStructures;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //_OpenGl_PriorityList_Header
tel_colour vcolours; /* Vertex colour values */
tel_point vnormals; /* Vertex normals */
tel_texture_coord vtexturecoord; /* Texture coordinates */
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
class OpenGl_QuadrangleStrip : public OpenGl_Element
DS_INTERNAL *myDS;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_QuadrangleStrip_Header
OpenGl_ListOfGroup myGroups;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_Structure_Header
const wchar_t *myString;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_Text_Header
int Height;
Graphic3d_HorizontalTextAlignment HAlign;
Graphic3d_VerticalTextAlignment VAlign;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //_OpenGl_TextParam_Header
texDataStatus status;
GLint type;
int share_count;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
GLfloat transx, transy;
GLfloat angle;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
*/
#include <OpenGl_tgl_all.hxx>
+#include <Standard_DefineAlloc.hxx>
#include <GL/gl.h>
GLfloat scalex, scaley;
GLfloat transx, transy;
GLfloat angle;
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
typedef _TextureData TextureData;
tel_colour vcolours; /* length = num_facets + 2 */
tel_point vnormals; /* length = num_facets + 2 */
tel_texture_coord vtexturecoord; /* Texture coordinates */
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
class OpenGl_TriangleStrip : public OpenGl_Element
DS_INTERNAL *myDS;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //OpenGl_TriangleStrip_Header
OpenGl_AspectText myAspectText;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //_OpenGl_Trihedron_Header
struct OPENGL_CLIP_REP
{
Standard_Real equation[4];
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
struct OPENGL_ZCLIP
Standard_Boolean myResetFLIST;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#endif //_OpenGl_View_Header
{
GLboolean isEnabled;
GLdouble Equation[4];
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
/*----------------------------------------------------------------------*/
public:
DEFINE_STANDARD_RTTI(OpenGl_Window) // Type definition
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
public:
DEFINE_STANDARD_RTTI(OpenGl_Workspace) // Type definition
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};
#include <Poly_CoherentTriangle.hxx>
#ifdef WNT
-#pragma warning(disable:4291 4996)
+#pragma warning(disable:4996)
#endif
//=======================================================================
#include <Poly_CoherentTriPtr.hxx>
-#ifdef WNT
-#pragma warning(disable:4291)
-#endif
-
//=======================================================================
//function : Iterator::Next
//purpose :
#define Poly_CoherentTriPtr_HeaderFile
#include <NCollection_BaseAllocator.hxx>
+#include <NCollection_DefineAlloc.hxx>
class Poly_CoherentTriangle;
#ifdef WNT
#pragma warning (push)
-#pragma warning(disable:4355 4291) //'this' : used in base member initializer list
+#pragma warning(disable:4355) //'this' : used in base member initializer list
#endif
/**
/**
* Operator new for dynamic allocations
*/
- void* operator new (Standard_Size theSize,
- const Handle(NCollection_BaseAllocator)& theAllocator)
- {
- return theAllocator->Allocate(theSize);
- }
+ DEFINE_NCOLLECTION_ALLOC
/**
* Query the stored pointer to Triangle.
Standard_Integer nd; // the second node of the edge
Standard_Integer nt[2]; // the two adjacent triangles
Standard_Integer nn[2]; // the two adjacent nodes
- void* operator new(size_t aSize)
- {return (void*)(Standard::Allocate(aSize));}
-// void operator delete(void* aNode, size_t aSize) {
- void operator delete(void* aNode) {
- Standard_Address anAdress = (Standard_Address)aNode;
- Standard::Free(anAdress);
- }
+ DEFINE_STANDARD_ALLOC
};
Poly_Connect::Poly_Connect(const Handle(Poly_Triangulation)& T) :
Standard_DefineHandle.hxx
Standard_UUID.cxx
Standard_UUID.hxx
-StandardCSFDB.cxx
Standard_Version.hxx
Standard_Mutex.hxx
Standard_Mutex.cxx
Standard_MMgrTBBalloc.cxx
Standard_MMgrTBBalloc.hxx
Standard_Assert.hxx
+Standard_DefineAlloc.hxx
#ifndef _Handle_Standard_Persistent_HeaderFile
#define _Handle_Standard_Persistent_HeaderFile
+#ifndef _Standard_DefineAlloc_HeaderFile
+#include <Standard_DefineAlloc.hxx>
+#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
Standard_EXPORT Standard_Integer HashCode(const Handle(Standard_Persistent)& ,
const Standard_Integer);
-Standard_EXPORT Standard_Address StandardCSFDB_Allocate(const Standard_Size);
-Standard_EXPORT void StandardCSFDB_Free(Standard_Address&);
class Handle(Standard_Persistent)
{
public:
- void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- void* operator new(size_t size)
- {
- return StandardCSFDB_Allocate(size);
- }
- void operator delete(void *anAddress)
- {
- if (anAddress) StandardCSFDB_Free(anAddress);
- }
+ DEFINE_STANDARD_ALLOC
Handle(Standard_Persistent)()
{
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
+#ifndef _Standard_DefineAlloc_HeaderFile
+#include <Standard_DefineAlloc.hxx>
+#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
Standard_EXPORT void EndScope();
public:
- // Redefined operators new and delete ensure that handles are
- // allocated using OCC memory manager
- void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- void operator delete(void *anAddress, size_t )
- {
- if (anAddress) Standard::Free(anAddress);
- }
+ DEFINE_STANDARD_ALLOC
private:
// Field
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-#include <Standard_PrimitiveTypes.hxx>
-#include <Standard_Persistent.hxx>
-//#include <Standard_Type.hxx>
-//#include <Standard_Stream.hxx>
-#include <Standard.hxx>
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif
-
-//class Handle(Standard_Type);
-
-//extern const Handle(Standard_Transient) Standard_TransientNullHandle;
-//extern const Handle(Standard_Persistent) Standard_PersistentNullHandle;
-//const Handle(Standard_Transient) Standard_TransientNullHandle;
-//const Handle(Standard_Persistent) Standard_PersistentNullHandle;
-
-//---------------------------------------------------
-
-#ifdef WNT
-# include <windows.h>
-# include <winbase.h>
-#endif
-
-//=======================================================================
-//function : CSFDB_Allocate
-//purpose :
-//=======================================================================
-
-Standard_Address StandardCSFDB_Allocate(const Standard_Size aSize)
-{
- return Standard::Allocate( aSize );
-}
-
-
-//=======================================================================
-//function : Free
-//purpose :
-//=======================================================================
-
-void StandardCSFDB_Free(Standard_Address& aStorage )
-{
- Standard::Free( aStorage );
-}
-
-//=======================================================================
-//function : Reallocate
-//purpose :
-//=======================================================================
-
-Standard_EXPORT Standard_Address StandardCSFDB_Reallocate
- (Standard_Address& aStorage,
- const Standard_Size ,
- const Standard_Size newSize)
-{
- return Standard::Reallocate( aStorage, newSize );
-}
--- /dev/null
+// File: Standard_DefineAlloc.hxx
+// Created: Jan 19 10:33:16 2012
+// Author: Dmitry BOBYLEV
+// Copyright: Open CASCADE SAS 2012
+
+#ifndef _Standard_DefineAlloc_HeaderFile
+# define _Standard_DefineAlloc_HeaderFile
+
+// Macro to override new and delete operators for arrays.
+// Defined to empty for old SUN compiler
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530)
+# define DEFINE_STANDARD_ALLOC_ARRAY
+# else
+# define DEFINE_STANDARD_ALLOC_ARRAY \
+ void* operator new[] (size_t theSize) \
+ { \
+ return Standard::Allocate (theSize); \
+ } \
+ void operator delete[] (void* theAddress) \
+ { \
+ Standard::Free (theAddress); \
+ }
+# endif
+
+// Macro to override placement new and placement delete operators.
+// For Borland C and old SUN compilers do not define placement delete
+// as it is not supported.
+# if defined(__BORLANDC__) || (defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530))
+# define DEFINE_STANDARD_ALLOC_PLACEMENT \
+ void* operator new (size_t, void* theAddress) \
+ { \
+ return theAddress; \
+ }
+# else
+# define DEFINE_STANDARD_ALLOC_PLACEMENT \
+ void* operator new (size_t, void* theAddress) \
+ { \
+ return theAddress; \
+ } \
+ void operator delete (void*, void*) \
+ { \
+ }
+# endif
+
+// Macro to override operators new and delete to use OCC memory manager
+# define DEFINE_STANDARD_ALLOC \
+ void* operator new (size_t theSize) \
+ { \
+ return Standard::Allocate (theSize); \
+ } \
+ void operator delete (void* theAddress) \
+ { \
+ Standard::Free ((Standard_Address&)theAddress); \
+ } \
+ DEFINE_STANDARD_ALLOC_ARRAY \
+ DEFINE_STANDARD_ALLOC_PLACEMENT
+
+// Declare operator new in global scope for old sun compiler
+#ifndef WORKAROUND_SUNPRO_NEW_PLACEMENT
+#define WORKAROUND_SUNPRO_NEW_PLACEMENT
+#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x420)
+inline void* operator new(size_t,void* anAddress)
+{
+ return anAddress;
+}
+#endif
+#endif
+
+#endif
\ No newline at end of file
#endif /* HAVE_CONFIG_H */
// Standard OCC macros: Handle(), STANDARD_TYPE()
-# define Handle(ClassName) Handle_##ClassName
+# define Handle(ClassName) Handle_##ClassName
# define STANDARD_TYPE(aType) aType##_Type_()
//======================================================
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
+#ifndef _Standard_DefineAlloc_HeaderFile
+#include <Standard_DefineAlloc.hxx>
+#endif
#ifndef _Standard_PrimitiveTypes_HeaderFile
#include <Standard_PrimitiveTypes.hxx>
#endif
class Standard_Type;
class Storage_stCONSTclCOM;
-Standard_EXPORT Standard_Address StandardCSFDB_Allocate(const Standard_Size);
-Standard_EXPORT void StandardCSFDB_Free(Standard_Address&);
Standard_EXPORT const Handle_Standard_Type& Standard_Persistent_Type_();
class Standard_Persistent
Standard_Integer _typenum;
Standard_Integer _refnum;
public:
- // MEMORY MANAGER
- //
- void* operator new (size_t s) {
- return StandardCSFDB_Allocate(s);
- }
-
- void operator delete (void* p) {
- StandardCSFDB_Free(p);
- }
-
- void* operator new(size_t,void* anAddress) {
- return anAddress;
- }
-
+
+ DEFINE_STANDARD_ALLOC
+
Standard_EXPORT virtual Handle_Standard_Persistent This() const;
Standard_EXPORT virtual Handle_Standard_Persistent ShallowCopy () const;
Standard_EXPORT virtual void Delete() const;
#ifndef _Standard_Transient_proto_HeaderFile
#define _Standard_Transient_proto_HeaderFile
+#ifndef _Standard_DefineAlloc_HeaderFile
+#include <Standard_DefineAlloc.hxx>
+#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
friend class Handle(Standard_Transient);
public:
- //! Operator new for placement in pre-allocated memory
- void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- //! Operator new for memory allocation uses Open CASCADE memory manager
- void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- //! Operator delete symmetric to operator new
- void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
+
+ DEFINE_STANDARD_ALLOC
//! Empty constructor
Standard_Transient() : count(0) {}
typedef const char* Standard_CString;
typedef const short* Standard_ExtString;
-// declare operator new in global scope for old sun compiler
-#ifndef WORKAROUND_SUNPRO_NEW_PLACEMENT
-#define WORKAROUND_SUNPRO_NEW_PLACEMENT
-#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x420)
-inline void* operator new(size_t,void* anAddress)
-{
- return anAddress;
-}
-#endif
-#endif
-
#endif
public:
Storage_Bucket() : mySpace(0L), mySpaceSize(200000), myCurrentSpace(-1)
{
- mySpace = (Standard_Persistent**)StandardCSFDB_Allocate(sizeof(Standard_Persistent*) * mySpaceSize);
+ mySpace = (Standard_Persistent**)Standard::Allocate(sizeof(Standard_Persistent*) * mySpaceSize);
}
Storage_Bucket(const Standard_Integer theSpaceSize) : mySpace(0L), mySpaceSize(theSpaceSize), myCurrentSpace(-1)
{
- mySpace = (Standard_Persistent**)StandardCSFDB_Allocate(sizeof(Standard_Persistent*) * mySpaceSize);
+ mySpace = (Standard_Persistent**)Standard::Allocate(sizeof(Standard_Persistent*) * mySpaceSize);
}
void Clear();
#endif
-extern Standard_Address StandardCSFDB_Reallocate
- (Standard_Address&,
- const Standard_Size,
- const Standard_Size);
-
// IMPLEMENTATION BucketOfPersistent
//
Storage_Bucket::~Storage_Bucket()
{
- StandardCSFDB_Free((Standard_Address&)mySpace);
+ Standard::Free((Standard_Address&)mySpace);
mySpace = 0L;
mySpaceSize = 0;
Clear();
: myNumberOfBucket(1),myNumberOfBucketAllocated(theBucketNumber),myBucketSize
(theBucketSize)
{
- myBuckets = (Storage_Bucket**)StandardCSFDB_Allocate
+ myBuckets = (Storage_Bucket**)Standard::Allocate
(sizeof(Storage_Bucket*) * theBucketNumber);
myBuckets[0] = new Storage_Bucket(myBucketSize);
myCurrentBucket = myBuckets[0];
{
Clear();
delete myBuckets[0];
- StandardCSFDB_Free((Standard_Address&)myBuckets);
+ Standard::Free((Standard_Address&)myBuckets);
myBuckets = 0L;
}
if (myNumberOfBucket > myNumberOfBucketAllocated) {
Standard_Size e = sizeof(Storage_Bucket*) * myNumberOfBucketAllocated;
- myBuckets = (Storage_Bucket**)StandardCSFDB_Reallocate((Standard_Address&)myBuckets,e,e * 2);
+ myBuckets = (Storage_Bucket**)Standard::Reallocate((Standard_Address&)myBuckets, e * 2);
myNumberOfBucketAllocated *= 2;
}
#ifndef TColStd_PackedMapOfInteger_HeaderFile
#define TColStd_PackedMapOfInteger_HeaderFile
+#include <Standard_DefineAlloc.hxx>
#include <TCollection_BasicMap.hxx>
/**
public:
// operators new and delete must be defined explicitly
// since inherited ones are not accessible
- void* operator new(size_t size)
- { return TCollection_BasicMap::operator new(size); }
- void operator delete(void *anAddress)
- { TCollection_BasicMap::operator delete (anAddress); }
+ DEFINE_STANDARD_ALLOC
public:
// ---------- PUBLIC METHODS ----------
aDelta->AddAttributeDelta(DELTACREATION); \
}
-#ifdef WNT
-// Disable the warning: "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
//=======================================================================
//function : TDF_Data
//purpose : empty constructor
myRoot = new (anIncAllocator) TDF_LabelNode (this);
}
-#ifdef WNT
-#pragma warning (default:4291)
-#endif
-
//=======================================================================
//function : Destroy
//purpose : Used to implement the destructor ~.
}
}
-#ifdef WNT
-// Disable the warning: "operator new unmatched by delete"
-#pragma warning (disable:4291)
-#endif
-
//=======================================================================
//function : FindOrAddChild
//purpose : Finds or adds a label child having <aTag> as tag.
return childLabelNode;
}
-#ifdef WNT
-#pragma warning (default:4291)
-#endif
-
//=======================================================================
//function : InternalDump
//purpose : Private method.
void * operator new (size_t aSize,
const Handle(NCollection_IncAllocator)& anAlloc)
{ return anAlloc -> Allocate (aSize); }
+#if !defined(__BORLANDC__) && (!defined(__SUNPRO_CC) || (__SUNPRO_CC > 0x530))
+ void operator delete (void* theAddress,
+ const Handle(NCollection_IncAllocator)& anAlloc)
+ {
+ }
+#endif
void operator delete(void *) { }
// nothing to do in operator delete since IncAllocator does not need it
// Public Friends
#endif
};
-#endif
+#endif
\ No newline at end of file
Standard_Boolean IsValidInTrans(Standard_Integer Trans);
// Memory management
- void* operator new(size_t aSize) {
- return Standard::Allocate(aSize);
- }
-
-/* attempt to eliminate compiler warning
- void* operator new(size_t, void* aNode) {
- return aNode;
- }
-
- void operator delete(void* aNode) {
- Standard::Free(aNode);
- }
-*/
-
- void operator delete(void* aNode, size_t aSize) {
- Standard::Free(aNode);
- }
+ DEFINE_STANDARD_ALLOC
TNaming_PtrRefShape myOld;
TNaming_PtrRefShape myNew;
public:
- IMPLEMENT_MEMORY_OPERATORS
+ DEFINE_STANDARD_ALLOC
};