MongoDB  2.7.0
moveablebuffer.h
1 /* moveablebuffer.h
2 */
3 
4 /* Copyright 2009 10gen Inc.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #pragma once
20 
21 namespace mongo {
22 
26  struct MoveableBuffer {
28  MoveableBuffer(void *);
29  MoveableBuffer& operator=(const MoveableBuffer&);
30  ~MoveableBuffer();
31 
32  void *p;
33  };
34 
35  /* implementation (inlines) below */
36 
37  // this is a temp stub implementation...not really done yet - just having everything compile & such for checkpointing into git
38 
39  inline MoveableBuffer::MoveableBuffer() : p(0) { }
40 
41  inline MoveableBuffer::MoveableBuffer(void *_p) : p(_p) { }
42 
43  inline MoveableBuffer& MoveableBuffer::operator=(const MoveableBuffer& r) {
44  p = r.p;
45  return *this;
46  }
47 
48  inline MoveableBuffer::~MoveableBuffer() {
49  }
50 
51 }
this is a sort of smart pointer class where we can move where something is and all the pointers will ...
Definition: moveablebuffer.h:26