RFA: Reorder Initializers (2 of 3)

Jeffrey Oldham oldham at codesourcery.com
Wed Mar 28 23:39:05 UTC 2001


The large patch I sent out yesterday was too complicated.  Thus, I
have split it into five pieces:

1) Add typenames.			 
2) Reorder constructor initializers.	<-- this patch
3) Other changes.
4) Preprocessor changes. (withdrawn)
5) Changes to deprecated directories. (withdrawn)

I withdraw the large patch.  (I cut the large patch apart by hand so
small typos may be present.)

Scott Haney indicated he wants to review these changes.

2001-03-27  Jeffrey D. Oldham  <oldham at codesourcery.com>

	* Array/PrintArray.h (PrintArray::PrintArray): Reorder
	constructor's initializers to reflect class declaration order.
	* Domain/Grid.h (Grid::Grid): Add a base class initializer.
	* Engine/IndexFunctionEngine.h (Engine): Reorder constructor's
	initializers to reflect class declaration order.
	* Engine/RemoteEngine.h	(GatherContextsData::GatherContextsData):
	Add a base class initializer.
	* Layout/DynamicEvents.h (CreateEvent::CreateEvent): Likewise.
	(DestroyEvent::DestroyEvent): Likewise.
	(CopyEvent::CopyEvent): Likewise.
	(CopyPatchEvent::CopyPatchEvent): Likewise.
	* Layout/GlobalIDDataBase.h (Pack::Pack): Likewise.
	* Utilities/RefCountedBlockPtr.h
	(RefBlockController::RefBlockController): Reorder constructor's
	initializers to reflect class declaration order.
	(RefCountedBlockPtr): Change preprocessor line.
	(RefCountedBlockPtr::RefCountedBlockPtr): Reorder constructor's
	initializers to reflect class declaration order.


Tested on	sequential Linux using gcc 3.1
Approved by	???Scott Haney???

Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com
-------------- next part --------------
Index: Array/PrintArray.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Array/PrintArray.h,v
retrieving revision 1.20
diff -c -p -r1.20 PrintArray.h
*** Array/PrintArray.h	2000/07/20 15:36:24	1.20
--- Array/PrintArray.h	2001/03/28 01:59:29
*************** public:
*** 202,208 ****
  	     bool scientific = false, int spacing = 1)
      : domainwidth_m(domainWidth), datawidth_m(dataWidth), 
        dataprecision_m(dataPrecision), carreturn_m(carReturn),
!       scientific_m(scientific), spacing_m(spacing)
      {
        PAssert(domainwidth_m > 0);
        PAssert(datawidth_m > 0);
--- 202,208 ----
  	     bool scientific = false, int spacing = 1)
      : domainwidth_m(domainWidth), datawidth_m(dataWidth), 
        dataprecision_m(dataPrecision), carreturn_m(carReturn),
!       spacing_m(spacing), scientific_m(scientific)
      {
        PAssert(domainwidth_m > 0);
        PAssert(datawidth_m > 0);
Index: Domain/Grid.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Domain/Grid.h,v
retrieving revision 1.10
diff -c -p -r1.10 Grid.h
*** Domain/Grid.h	2000/06/27 01:58:27	1.10
--- Domain/Grid.h	2001/03/28 01:59:32
*************** public:
*** 352,358 ****
    Grid() { }
  
    // copy constructor
!   Grid(const Grid<1> &a) {
      NewDomain1<Grid<1> >::fill(*this, a);
    }
  
--- 352,360 ----
    Grid() { }
  
    // copy constructor
!   Grid(const Grid<1> &a)
!     : Base_t ()
!   {
      NewDomain1<Grid<1> >::fill(*this, a);
    }
  
Index: Engine/IndexFunctionEngine.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Engine/IndexFunctionEngine.h,v
retrieving revision 1.19
diff -c -p -r1.19 IndexFunctionEngine.h
*** Engine/IndexFunctionEngine.h	2000/09/26 21:04:29	1.19
--- Engine/IndexFunctionEngine.h	2001/03/28 01:59:32
*************** public:
*** 122,128 ****
    // Construct from a domain object and an optional Functor object.
  
    Engine(const Domain_t &domain, const Functor &f = Functor())
!   : domain_m(domain), funct_m(f) 
    { 
      for (int d = 0; d < Dim; ++d)
        firsts_m[d] = domain[d].first();
--- 122,128 ----
    // Construct from a domain object and an optional Functor object.
  
    Engine(const Domain_t &domain, const Functor &f = Functor())
!   : funct_m(f), domain_m(domain)
    { 
      for (int d = 0; d < Dim; ++d)
        firsts_m[d] = domain[d].first();
*************** public:
*** 139,145 ****
    // Construct from another index-function-engine.
  
    Engine(const This_t &model)
!   : domain_m(model.domain()), funct_m(model.functor()) 
    { 
      for (int d = 0; d < Dim; ++d)
        firsts_m[d] = model.firsts_m[d];
--- 139,145 ----
    // Construct from another index-function-engine.
  
    Engine(const This_t &model)
!   : funct_m(model.functor()), domain_m(model.domain())
    { 
      for (int d = 0; d < Dim; ++d)
        firsts_m[d] = model.firsts_m[d];
Index: Engine/RemoteEngine.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Engine/RemoteEngine.h,v
retrieving revision 1.30
diff -c -p -r1.30 RemoteEngine.h
*** Engine/RemoteEngine.h	2000/09/20 16:22:07	1.30
--- Engine/RemoteEngine.h	2001/03/28 01:59:33
*************** private:
*** 1671,1677 ****
      
      inline GatherContextsData() {}
      inline GatherContextsData(const GatherContextsData &model)
!     : contexts_m(model.contexts_m) {}
      inline ~GatherContextsData() {}
  
      //-------------------------------------------------------------------------
--- 1671,1677 ----
      
      inline GatherContextsData() {}
      inline GatherContextsData(const GatherContextsData &model)
!     : RefCounted (), contexts_m(model.contexts_m) {}
      inline ~GatherContextsData() {}
  
      //-------------------------------------------------------------------------
Index: Layout/DynamicEvents.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Layout/DynamicEvents.h,v
retrieving revision 1.11
diff -c -p -r1.11 DynamicEvents.h
*** Layout/DynamicEvents.h	2000/03/07 13:17:34	1.11
--- Layout/DynamicEvents.h	2001/03/28 01:59:35
*************** public:
*** 249,256 ****
    // is < 0, the create should be done in the last local patch.
  
    CreateEvent(CreateSize_t num, PatchID_t p)
!     : amount_m(num), patch_m(p),
!       ObserverEvent(DynamicEvents::create)
      {
      }
  
--- 249,256 ----
    // is < 0, the create should be done in the last local patch.
  
    CreateEvent(CreateSize_t num, PatchID_t p)
!     : ObserverEvent(DynamicEvents::create),
!       amount_m(num), patch_m(p)
      {
      }
  
*************** public:
*** 330,337 ****
  
    template<class D>
    DestroyEvent(const D &d, PatchID_t p, int method)
!     : domain_m(d), patch_m(p), method_m(method),
!       ObserverEvent(DynamicEventType<Dom>::destroyCode)
      {
        CTAssert(DynamicEventType<Dom>::dimensions == 1);
      }
--- 330,337 ----
  
    template<class D>
    DestroyEvent(const D &d, PatchID_t p, int method)
!     : ObserverEvent(DynamicEventType<Dom>::destroyCode),
!       domain_m(d), patch_m(p), method_m(method)
      {
        CTAssert(DynamicEventType<Dom>::dimensions == 1);
      }
*************** public:
*** 421,436 ****
    // copy to.
  
    CopyEvent(const Dom &d, PatchID_t fromp, PatchID_t top)
!     : domain_m(d), from_m(fromp), to_m(top),
!       ObserverEvent(DynamicEventType<Dom>::copyCode)
      {
        CTAssert(DynamicEventType<Dom>::dimensions == 1);
      }
  
    template<class D>
    CopyEvent(const D &d, PatchID_t fromp, PatchID_t top)
!     : domain_m(d), from_m(fromp), to_m(top),
!       ObserverEvent(DynamicEventType<Dom>::copyCode)
      {
        CTAssert(DynamicEventType<Dom>::dimensions == 1);
      }
--- 421,436 ----
    // copy to.
  
    CopyEvent(const Dom &d, PatchID_t fromp, PatchID_t top)
!     : ObserverEvent(DynamicEventType<Dom>::copyCode),
!       domain_m(d), from_m(fromp), to_m(top)
      {
        CTAssert(DynamicEventType<Dom>::dimensions == 1);
      }
  
    template<class D>
    CopyEvent(const D &d, PatchID_t fromp, PatchID_t top)
!     : ObserverEvent(DynamicEventType<Dom>::copyCode),
!       domain_m(d), from_m(fromp), to_m(top)
      {
        CTAssert(DynamicEventType<Dom>::dimensions == 1);
      }
*************** public:
*** 534,541 ****
  
    CopyPatchEvent(const Domain_t &domlists, const IDList_t &fromlist,
  		 PatchID_t top, bool create)
!     : lists_m(domlists), from_m(fromlist), to_m(top), create_m(create),
!       ObserverEvent(DynamicEvents::copyPatchList)
      {
      }
  
--- 534,541 ----
  
    CopyPatchEvent(const Domain_t &domlists, const IDList_t &fromlist,
  		 PatchID_t top, bool create)
!     : ObserverEvent(DynamicEvents::copyPatchList),
!       lists_m(domlists), from_m(fromlist), to_m(top), create_m(create)
      {
      }
  
Index: Layout/GlobalIDDataBase.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Layout/GlobalIDDataBase.h,v
retrieving revision 1.13
diff -c -p -r1.13 GlobalIDDataBase.h
*** Layout/GlobalIDDataBase.h	2000/07/12 19:17:12	1.13
--- Layout/GlobalIDDataBase.h	2001/03/28 01:59:35
*************** private:
*** 193,199 ****
    struct Pack
    {
      Pack()
!       : layoutID_m(0), globalID_m(0), context_m(0), parent_m(0)
      { }
  
      inline
--- 193,199 ----
    struct Pack
    {
      Pack()
!       : layoutID_m(0), context_m(0), globalID_m(0), parent_m(0)
      { }
  
      inline
Index: Utilities/RefCountedBlockPtr.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Utilities/RefCountedBlockPtr.h,v
retrieving revision 1.57
diff -c -p -r1.57 RefCountedBlockPtr.h
*** Utilities/RefCountedBlockPtr.h	2001/03/21 00:56:09	1.57
--- Utilities/RefCountedBlockPtr.h	2001/03/28 01:59:37
*************** public: 
*** 128,134 ****
  
    explicit 
    RefBlockController(size_t size)
!     : dealloc_m(false), pBegin_m(0), pEnd_m(0), pEndOfStorage_m(0)
    {
      // Allocate memory, and set pointers to beginning and ending.  This
      // also sets the dealloc_m flag to true.
--- 128,134 ----
  
    explicit 
    RefBlockController(size_t size)
!     : pBegin_m(0), pEnd_m(0), pEndOfStorage_m(0), dealloc_m(false)
    {
      // Allocate memory, and set pointers to beginning and ending.  This
      // also sets the dealloc_m flag to true.
*************** public:
*** 583,590 ****
    // Initialize a block of a given size, optionally with a model.
  
    inline explicit RefCountedBlockPtr(size_t size)
!     : blockControllerPtr_m(new Controller(size)),
!       offset_m(0)
    { }
  
    inline RefCountedBlockPtr(size_t size, const T & model)
--- 583,590 ----
    // Initialize a block of a given size, optionally with a model.
  
    inline explicit RefCountedBlockPtr(size_t size)
!     : offset_m(0),
!       blockControllerPtr_m(new Controller(size))
    { }
  
    inline RefCountedBlockPtr(size_t size, const T & model)
*************** public:
*** 620,627 ****
    // Copy constructor
  
    inline RefCountedBlockPtr(const This_t & model)
!     : blockControllerPtr_m(model.blockControllerPtr_m),
!       offset_m(model.offset_m)
    { }
  
    // Copy constructor from a RefCountedBlockPtr of the opposite bounds
--- 620,627 ----
    // Copy constructor
  
    inline RefCountedBlockPtr(const This_t & model)
!     : offset_m(model.offset_m),
!       blockControllerPtr_m(model.blockControllerPtr_m)
    { }
  
    // Copy constructor from a RefCountedBlockPtr of the opposite bounds


More information about the pooma-dev mailing list