Last change
on this file since 2314 was
591,
checked in by rlacroix, 10 years ago
|
Remove leftovers from the XMLIO age.
|
-
Property copyright set to
Software name : XIOS (Xml I/O Server) http://forge.ipsl.jussieu.fr/ioserver Creation date : January 2009 Licence : CeCCIL version2 see license file in root directory : Licence_CeCILL_V2-en.txt or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement) CNRS/IPSL (Institut Pierre Simon Laplace) Project Manager : Yann Meurdesoif yann.meurdesoif@cea.fr
-
Property svn:eol-style set to
native
|
File size:
777 bytes
|
Line | |
---|
1 | #include "xios_spl.hpp" |
---|
2 | #include "buffer.hpp" |
---|
3 | |
---|
4 | |
---|
5 | namespace xios |
---|
6 | { |
---|
7 | CBuffer::CBuffer(void* buffer_,size_t size_) |
---|
8 | { |
---|
9 | own=false ; |
---|
10 | realloc(buffer_,size_) ; |
---|
11 | } |
---|
12 | |
---|
13 | CBuffer::CBuffer(size_t size_) |
---|
14 | { |
---|
15 | own=false ; |
---|
16 | realloc(size_) ; |
---|
17 | } |
---|
18 | |
---|
19 | void CBuffer::realloc(size_t size_) |
---|
20 | { |
---|
21 | realloc(new char[size_],size_) ; |
---|
22 | own=true ; |
---|
23 | } |
---|
24 | |
---|
25 | void CBuffer::realloc(void* buffer_,size_t size_) |
---|
26 | { |
---|
27 | if (own) delete [] buffer ; |
---|
28 | buffer=(char*)buffer_ ; |
---|
29 | size=size_ ; |
---|
30 | count=0 ; |
---|
31 | read=buffer ; |
---|
32 | write=buffer ; |
---|
33 | own=false ; |
---|
34 | } |
---|
35 | |
---|
36 | size_t CBuffer::remain(void) |
---|
37 | { |
---|
38 | return size-count ; |
---|
39 | } |
---|
40 | |
---|
41 | CBuffer::~CBuffer() |
---|
42 | { |
---|
43 | if (own) delete [] buffer ; |
---|
44 | } |
---|
45 | |
---|
46 | } |
---|
47 | |
---|
48 | |
---|
49 | |
---|
Note: See
TracBrowser
for help on using the repository browser.