HeapTracked.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2004-2008 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Util/units/HeapTracked.h
10 
11 #ifndef __ReferenceHeapTracked_h
12 #define __ReferenceHeapTracked_h
13 
14 #include <vector>
15 #include <stdlib.h>
16 
17 namespace Reference {
18 
20  extern bool verbose;
21 
23 
48  class HeapTracked
49  {
50  public:
51 
53  HeapTracked () { __heap_state = 0; }
54 
56  HeapTracked (const HeapTracked&) { __heap_state = 0; }
57 
59  HeapTracked& operator = (const HeapTracked&) { return *this; }
60 
62  virtual ~HeapTracked () { }
63 
65  static void* operator new (size_t size, void* ptr = 0);
66 
68  static void operator delete (void* location, void* ptr);
69 
71  static void operator delete (void* location);
72 
74  bool __is_on_heap () const;
75 
77  static size_t get_heap_queue_size ();
78 
79  private:
80 
81  friend class Able;
82 
84  mutable char __heap_state;
85 
87  void __set_deleted ();
88 
89  };
90 
91 }
92 
93 #endif
94 
Directional antennae.
Definition: Directional.h:17
void set_observatory_latitude(double latitude)
Set the latitude of the observatory in radians.
Definition: Mount.C:39
Base class of antenna/telescope mount types.
Definition: Mount.h:20
void set_source_coordinates(const sky_coord &coords)
Set the coordinates of the source.
Definition: Mount.C:31
Contains two basic classes that simplify dynamic memory management.
Definition: HeapTracked.h:17
double get_hour_angle() const
Get the hour_angle in radians.
Definition: Mount.C:86
A convenient exception handling class.
Definition: Error.h:54
HeapTracked()
Default constructor.
Definition: HeapTracked.h:58
Determines if the instance was dynamically allocated on the heap.
Definition: HeapTracked.h:53
HeapTracked & operator=(const HeapTracked &)
Assignment operator.
Definition: HeapTracked.h:64
static const Site * location(const std::string &antenna)
Get the location of the named antenna.
Definition: Site_location.C:22
virtual void get_sph(double &lat, double &lon, double &rad) const =0
Get the latitude and longitude in radians, and radius in metres.
virtual ~HeapTracked()
Destructor.
Definition: HeapTracked.h:67
void set_observatory_longitude(double longitude)
Set the longitude of the observatory in radians East of Greenwich.
Definition: Mount.C:51
double get_azimuth() const
Get the azimuth angle in radians.
Definition: Horizon.C:27
bool __is_on_heap() const
Return true if this instance is found in heap addresses.
Definition: HeapTracked.C:96
bool verbose
Verbosity flag.
Definition: ReferenceAble.h:27
Class for dealing with angular info.
Definition: Angle.h:27
double get_local_sidereal_time() const
Get the LST in radians.
Definition: Mount.C:100
void set_local_sidereal_time(double rad)
Set the LST in radians.
Definition: Mount.C:93
Class for sky coordinates.
Definition: sky_coord.h:19
static size_t get_heap_queue_size()
Return the number of heap addresses awaiting processing.
Definition: HeapTracked.C:47
Class for representing modified Julian dates with high precision.
Definition: MJD.h:27
Site coordinates.
Definition: Site.h:25
Horizon mounted antenna with first rotation in horizontal plane.
Definition: Horizon.h:18
double get_zenith() const
Get the zenith angle in radians.
Definition: Horizon.C:41

Generated using doxygen 1.8.17