Cat
RAM.cpp
Go to the documentation of this file.
1 // $Id: $
2 // Include files
3 
4 
5 // local
6 #include "RAM.h"
7 
8 //-----------------------------------------------------------------------------
9 // Implementation file for class : RAM
10 //
11 // 2006-10-23 :
12 //-----------------------------------------------------------------------------
13 
14 //=============================================================================
15 // Standard constructor, initializes variables
16 //=============================================================================
18  setName("RAM");
19  setType("RAM");
20 }
21 //=============================================================================
22 // Destructor
23 //=============================================================================
25 
26 //=============================================================================
27 // Destructor
28 //=============================================================================
29 StatusCode RAM::setSize(unsigned int width, unsigned int depth){
30  if (0!=width%8){
31  width=(width/8)+8;
32  warning("The width is not an integer number of octet. Width is set to "+
33  itos(width),"RAM::RAM");
34  return StatusCode::FAILURE;
35  }
36  m_width=width/8;
37  m_depth=depth;
39  return StatusCode::SUCCESS;
40 }
41 
42 //=============================================================================
44  U8* data=io()->dataU8();
45  for (int i=0; i<m_depth*m_width;++i){
46  data[i]=i;
47  }
48  write();
49  return StatusCode::SUCCESS;
50 }
std::string itos(int)
Definition: Tools.cpp:46
StatusCode setSize(unsigned int, unsigned int)
Definition: RAM.cpp:29
virtual StatusCode write()
Definition: IOobject.h:80
void setName(std::string name)
Definition: Object.h:51
int m_width
Definition: RAM.h:43
int width()
Definition: RAM.h:36
void setType(std::string type)
Definition: Object.h:52
int m_depth
Definition: RAM.h:44
def data(object, stream=None)
Definition: shell.py:150
StatusCode raz()
Definition: RAM.cpp:43
int depth()
Definition: RAM.h:32
U8 * dataU8()
Definition: IOdata.h:214
RAM()
Standard constructor.
Definition: RAM.cpp:17
unsigned char U8
Definition: IOobject.h:21
void defDataU8(unsigned long size)
Definition: IOdata.h:179
void warning(std::string mymsg)
Definition: Object.h:39
IOdata * io()
Definition: IOobject.h:66
virtual ~RAM()
Destructor.
Definition: RAM.cpp:24