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
48
Memory::Memory
()
49
{
50
// default constructor
51
}
52
53
Memory::~Memory
()
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
*/
Gws::Memory::~Memory
virtual ~Memory()
Definition:
Memory.cpp:53
Memory.h
Gws::Memory::Memory
Memory()
Definition:
Memory.cpp:48
Gws::Memory::kBig
Definition:
Memory.h:59
Gws::Memory::kLittle
Definition:
Memory.h:59
src
system
Memory.cpp
Generated on Wed Sep 20 2017 17:26:18 for GammaWare by
1.8.7