fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / FileIO / OpenFlight / OSGOFControlRecords.cpp
blobec62eb4382136f99f5fd806f627210d26063689c
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2011 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
18 * *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
27 * *
28 \*---------------------------------------------------------------------------*/
30 #include "OSGOFControlRecords.h"
32 #include "OSGOFDatabase.h"
33 #include "OSGOpenFlightLog.h"
35 OSG_BEGIN_NAMESPACE
37 //---------------------------------------------------------------------
38 // OFPushLevelRecord
39 //---------------------------------------------------------------------
41 /* static */
42 OFRecordTransitPtr OFPushLevelRecord::create(const OFRecordHeader &oHeader,
43 OFDatabase &oDB )
45 return OFRecordTransitPtr(new OFPushLevelRecord(oHeader, oDB));
48 /* virtual */
49 bool OFPushLevelRecord::read(std::istream &is)
51 OSG_OPENFLIGHT_LOG(("OFPushLevelRecord::read\n"));
53 _oDB.pushLevel();
55 return true;
58 /* virtual */
59 UInt16 OFPushLevelRecord::getOpCode(void) const
61 return OpCode;
64 OFPushLevelRecord::OFPushLevelRecord(const OFRecordHeader &oHeader,
65 OFDatabase &oDB ) :
66 Inherited(oHeader, oDB)
70 /* virtual */
71 OFPushLevelRecord::~OFPushLevelRecord(void)
75 /* static */
76 OFRecordFactoryBase::RegisterRecord OFPushLevelRecord::_regHelper(
77 &OFPushLevelRecord::create,
78 OFPushLevelRecord::OpCode );
80 //---------------------------------------------------------------------
81 // OFPopLevelRecord
82 //---------------------------------------------------------------------
84 /* static */
85 OFRecordTransitPtr OFPopLevelRecord::create(const OFRecordHeader &oHeader,
86 OFDatabase &oDB )
88 return OFRecordTransitPtr(new OFPopLevelRecord(oHeader, oDB));
91 /* virtual */
92 bool OFPopLevelRecord::read(std::istream &is)
94 OSG_OPENFLIGHT_LOG(("OFPopLevelRecord::read\n"));
96 _oDB.popLevel();
98 return true;
101 /* virtual */
102 UInt16 OFPopLevelRecord::getOpCode(void) const
104 return OpCode;
107 OFPopLevelRecord::OFPopLevelRecord(const OFRecordHeader &oHeader,
108 OFDatabase &oDB ) :
109 Inherited(oHeader, oDB)
113 /* virtual */
114 OFPopLevelRecord::~OFPopLevelRecord(void)
118 /* static */
119 OFRecordFactoryBase::RegisterRecord OFPopLevelRecord::_regHelper(
120 &OFPopLevelRecord::create,
121 OFPopLevelRecord::OpCode );
124 OSG_END_NAMESPACE