DataBlock.hh (6631:5437a0eeb822) DataBlock.hh (6762:a22a47e60c21)
1
2/*
3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 31 unchanged lines hidden (view full) ---

40 DataBlock() {alloc();}
41 DataBlock(const DataBlock & cp) {
42 m_data = new uint8[RubySystem::getBlockSizeBytes()];
43 memcpy(m_data, cp.m_data, RubySystem::getBlockSizeBytes());
44 m_alloc = true;
45 }
46
47 // Destructor
1
2/*
3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 31 unchanged lines hidden (view full) ---

40 DataBlock() {alloc();}
41 DataBlock(const DataBlock & cp) {
42 m_data = new uint8[RubySystem::getBlockSizeBytes()];
43 memcpy(m_data, cp.m_data, RubySystem::getBlockSizeBytes());
44 m_alloc = true;
45 }
46
47 // Destructor
48 ~DataBlock() { if(m_alloc) delete [] m_data;}
48 ~DataBlock() {
49 if(m_alloc) {
50 delete [] m_data;
51 }
52 }
49
50 DataBlock& operator=(const DataBlock& obj);
51
52 // Public Methods
53 void assign(uint8* data);
54
55 void clear();
56 uint8 getByte(int whichByte) const;

--- 111 unchanged lines hidden ---
53
54 DataBlock& operator=(const DataBlock& obj);
55
56 // Public Methods
57 void assign(uint8* data);
58
59 void clear();
60 uint8 getByte(int whichByte) const;

--- 111 unchanged lines hidden ---