Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / examples / APG / Shared_Memory / Record.h
blobcdcf0a306133d5af60cb161a36848c82cb0bd8c0
1 /**
2 * Sample code from The ACE Programmer's Guide,
3 * copyright 2003 Addison-Wesley. All Rights Reserved.
4 */
6 #ifndef __RECORD_H_
7 #define __RECORD_H_
9 #include "ace/OS_NS_string.h"
10 #include "ace/Based_Pointer_T.h"
12 // Listing 11 code/ch17
13 class Record
15 public:
16 Record () { }
17 ~Record () { }
19 Record (const Record& rec)
20 : id1_(rec.id1_), id2_(rec.id2_)
22 ACE_OS::strcpy (recName_, rec.name_);
23 this->name_ = recName_;
25 Record (int id1, int id2, char *name)
26 : id1_(id1), id2_(id2)
28 ACE_OS::strcpy (recName_, name);
29 this->name_ = recName_;
31 char *name () { return recName_; }
32 int id1 () { return id1_; }
33 int id2 () { return id2_; }
35 private:
36 int id1_;
37 int id2_;
38 char recName_[128];
39 ACE_Based_Pointer_Basic<char> name_;
41 // Listing 11
43 #endif /* __RECORD_H_ */