Last change
on this file since 1572 was
300,
checked in by ymipsl, 13 years ago
|
nouvelle version de developpement de xios
- nouvelle interface fortran
- recodage complet de la couche de communication
- et bien d'autres choses...
YM
|
-
Property svn:eol-style set to
native
|
File size:
817 bytes
|
Line | |
---|
1 | #include "xmlioserver_spl.hpp" |
---|
2 | #include "buffer_ym.hpp" |
---|
3 | |
---|
4 | |
---|
5 | namespace xmlioserver |
---|
6 | { |
---|
7 | namespace ym |
---|
8 | { |
---|
9 | CBuffer::CBuffer(void* buffer_,size_t size_) |
---|
10 | { |
---|
11 | own=false ; |
---|
12 | realloc(buffer_,size_) ; |
---|
13 | } |
---|
14 | |
---|
15 | CBuffer::CBuffer(size_t size_) |
---|
16 | { |
---|
17 | own=false ; |
---|
18 | realloc(size_) ; |
---|
19 | } |
---|
20 | |
---|
21 | void CBuffer::realloc(size_t size_) |
---|
22 | { |
---|
23 | realloc(new char[size_],size_) ; |
---|
24 | own=true ; |
---|
25 | } |
---|
26 | |
---|
27 | void CBuffer::realloc(void* buffer_,size_t size_) |
---|
28 | { |
---|
29 | if (own) delete [] buffer ; |
---|
30 | buffer=(char*)buffer_ ; |
---|
31 | size=size_ ; |
---|
32 | count=0 ; |
---|
33 | read=buffer ; |
---|
34 | write=buffer ; |
---|
35 | own=false ; |
---|
36 | } |
---|
37 | |
---|
38 | size_t CBuffer::remain(void) |
---|
39 | { |
---|
40 | return size-count ; |
---|
41 | } |
---|
42 | |
---|
43 | CBuffer::~CBuffer() |
---|
44 | { |
---|
45 | if (own) delete [] buffer ; |
---|
46 | } |
---|
47 | |
---|
48 | } |
---|
49 | } |
---|
50 | |
---|
51 | |
---|
52 | |
---|
Note: See
TracBrowser
for help on using the repository browser.