Pol  Revision:cb584c9
lockable.cpp
Go to the documentation of this file.
1 
7 #include "lockable.h"
8 
9 #include "../clib/cfgelem.h"
10 #include "../clib/streamsaver.h"
11 #include "uobject.h"
12 
13 namespace Pol
14 {
15 namespace Core
16 {
17 ULockable::ULockable( const Items::ItemDesc& itemdesc, UOBJ_CLASS uobj_class )
18  : Item( itemdesc, uobj_class )
19 {
20 }
21 
23 {
24  base::readProperties( elem );
25  locked( elem.remove_bool( "Locked", false ) );
26 }
27 
29 {
31 
32  if ( locked() )
33  sw() << "\tLocked\t" << locked() << pf_endl;
34 }
35 
36 // dave 12-20
38 {
39  ULockable* item = static_cast<ULockable*>( base::clone() );
40 
41  item->locked( locked() );
42  return item;
43 }
44 
46 {
47  return base::estimatedSize();
48 }
49 }
50 }
virtual void printProperties(Clib::StreamWriter &sw) const POL_OVERRIDE
Definition: lockable.cpp:28
virtual Items::Item * clone() const POL_OVERRIDE
Definition: lockable.cpp:37
virtual void readProperties(Clib::ConfigElem &elem) POL_OVERRIDE
Definition: lockable.cpp:22
ULockable(const Items::ItemDesc &itemdesc, UOBJ_CLASS uobj_class)
Definition: lockable.cpp:17
virtual void printProperties(Clib::StreamWriter &sw) const POL_OVERRIDE
Definition: item.cpp:337
virtual Item * clone() const
Definition: item.cpp:56
virtual void readProperties(Clib::ConfigElem &elem) POL_OVERRIDE
Definition: item.cpp:434
bool locked() const
Definition: lockable.h:65
virtual size_t estimatedSize() const POL_OVERRIDE
Definition: item00.cpp:58
#define pf_endl
Definition: proplist.cpp:25
virtual size_t estimatedSize() const POL_OVERRIDE
Definition: lockable.cpp:45
Definition: berror.cpp:12
bool remove_bool(const char *propname)
Definition: cfgfile.cpp:426