GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Memory.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2004 by Olivier Stezowski *
3  * stezow(AT)ipnl.in2p3.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * aLong_t with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
24 #ifndef GWS_MEMORY_H
25 #include "Memory.h"
26 #endif
27 
28 using namespace Gws;
29 
30 Memory::Agent::Agent()
31 {
32 // code from Fons
33  union endian_data {
34  int word;
35  char bytes[sizeof(int)];
36  };
37  union endian_data d;
38 
39  d.word = 0x1;
40  if (d.bytes[0] == 0x1)
41  fEndian = Memory::kLittle;
42  else
43  fEndian = Memory::kBig;
44 }
45 
46 Memory::Agent *Memory::gAgent = new Memory::Agent();
47 
49 {
50 // default constructor
51 }
52 
54 {
55 // destructor
56 }
57 
58 /*
59 void Memory::Copy(const Char_t *from, Char_t *to, Int_t size)
60 {
61 // copy size bytes of buf Int_to data
62  ::memcpy(to,from,size);
63 }
64 */
65 
66 /*
67 void Memory::Swap(Short_t *data, Char_t *buf, Int_t size)
68 {
69 // copy size bytes of buf (with byte swapping) Int_to data
70  Short_t *bufs = (Short_t *)buf; Int_t i;
71  for ( i = 0; i < size/2 ; i++ ) {
72  data[i] = ((((bufs[i]) >> 8) & 0xff) | (((bufs[i]) & 0xff) << 8));
73  }
74 }
75 */
virtual ~Memory()
Definition: Memory.cpp:53