Memory.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2009 - 2023 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 #ifndef __dsp_Memory_h_
10 #define __dsp_Memory_h_
11 
12 #include "Reference.h"
13 #include "environ.h"
14 
15 namespace dsp {
16 
18  class Memory : public Reference::Able
19  {
20  protected:
21  static Memory* manager;
22 
23  public:
24  static void* allocate (size_t nbytes);
25  static void free (void*);
26  static void set_manager (Memory*);
27  static Memory* get_manager ();
28 
29  virtual void* do_allocate (size_t nbytes) = 0;
30  virtual void do_free (void*) = 0;
31  virtual void do_zero (void* ptr, size_t nbytes) = 0;
32  virtual void do_copy (void* to, const void* from, size_t bytes) = 0;
33  virtual bool on_host () const = 0;
34  };
35 
36 }
37 
38 #endif
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
Manages memory allocation and destruction on the host machine.
Definition: MemoryHost.h:22
Pure virtual base class of objects that manage memory allocation and destruction.
Definition: Memory.h:23

Generated using doxygen 1.8.17