Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / apps / JAWS2 / JAWS / FILE.cpp
blob41ce5dfb3d6d9b206b426a5d650b04a340ee3e12
1 #include "ace/Guard_T.h"
3 #include "JAWS/FILE.h"
6 JAWS_FILE::JAWS_FILE ()
7 : map_ (0)
11 JAWS_FILE::~JAWS_FILE ()
13 delete this->map_;
14 this->map_ = 0;
17 ACE_Mem_Map *
18 JAWS_FILE::mem_map (int length,
19 int prot,
20 int share,
21 void *addr,
22 ACE_OFF_T offset,
23 LPSECURITY_ATTRIBUTES sa) const
25 JAWS_FILE *mutable_this = (JAWS_FILE *) this;
26 return mutable_this->mem_map (length, prot, share, addr, offset, sa);
29 ACE_Mem_Map *
30 JAWS_FILE::mem_map (int length,
31 int prot,
32 int share,
33 void *addr,
34 ACE_OFF_T offset,
35 LPSECURITY_ATTRIBUTES sa)
37 if (this->map_ == 0)
39 ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, g ,this->lock_, 0);
41 if (this->map_ == 0)
43 this->map_ = new ACE_Mem_Map;
44 if (this->map_ != 0)
46 int r = this->map_->map (this->get_handle (),
47 static_cast<size_t> (length),
48 prot,
49 share,
50 addr,
51 offset,
52 sa);
53 if (r < 0)
55 delete this->map_;
56 this->map_ = 0;
62 return this->map_;
66 ACE_Mem_Map *
67 JAWS_FILE::map () const
69 return this->map_;