summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-11-27 02:44:18 +0000
committerkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-11-27 02:44:18 +0000
commit659c8386c2a18a6a983e450f8a938476617c36df (patch)
treed2ac6c9ad767b82b7751c9f02fc2a63788be1782 /examples
parented0f9e2f533faa011407ee091b393010684a1039 (diff)
downloadATCD-659c8386c2a18a6a983e450f8a938476617c36df.tar.gz
*** empty log message ***
Diffstat (limited to 'examples')
-rw-r--r--examples/DLL/Magazine.h30
-rw-r--r--examples/DLL/Newsweek.h23
-rw-r--r--examples/DLL/Today.h28
-rw-r--r--examples/DLL/test_dll.cpp18
4 files changed, 81 insertions, 18 deletions
diff --git a/examples/DLL/Magazine.h b/examples/DLL/Magazine.h
index dbbc83ed940..b7f1857b120 100644
--- a/examples/DLL/Magazine.h
+++ b/examples/DLL/Magazine.h
@@ -1,5 +1,23 @@
+/* -*- C++ -*- */
// $Id$
+// ===========================================================
+//
+//
+// = LIBRARY
+// ACE_wrappers/examples/DLL
+//
+// = FILENAME
+// Magazine.h
+//
+// = DESCRIPTION
+// Abstract class whose methods are implemented by the derived classes.
+//
+// = AUTHOR
+// Kirthika Parameswaran <kirthika@cs.wustl.edu>
+//
+// ===========================================================
+
#ifndef MAGAZINE_H
#define MAGAZINE_H
@@ -9,17 +27,17 @@ class Magazine
// This is an abstract class used in the DLL example.
//
// = DESCRIPTION
- // This class simply is an inetrface which the derived classes will
- // exploit.
+ // This class simply is an inetrface which the derived classes
+ // will exploit.
public:
- // @@ Kirthika, please put the comments under the methods.
-
- // No-op virtual destructor.
+ // @@*done* Kirthika, please put the comments under the methods.
virtual ~Magazine (void) {};
+ // No-op vitrual destructor.
- // This method gives the title of the magazine.
virtual void title (void) = 0;
+ // This method gives the title of the magazine.
+
};
#endif /* MAGAZINE_H */
diff --git a/examples/DLL/Newsweek.h b/examples/DLL/Newsweek.h
index a1fb7f7d5fb..62507b4338c 100644
--- a/examples/DLL/Newsweek.h
+++ b/examples/DLL/Newsweek.h
@@ -1,5 +1,24 @@
+/* -*- C++ -*- */
// $Id$
+// ===========================================================
+//
+//
+// = LIBRARY
+// ACE_wrappers/examples/DLL
+//
+// = FILENAME
+// Newsweek.h
+//
+// = DESCRIPTION
+// This is a derived class from Magazine which is a magazine pertaining
+// to news and information.
+//
+// = AUTHOR
+// Kirthika Parameswaran <kirthika@cs.wustl.edu>
+//
+// ===========================================================
+
#ifndef NEWSWEEK_H
#define NEWSWEEK_H
@@ -20,11 +39,11 @@ class Newsweek : public Magazine
// of Magazine is bound to the Newsweek object at runtime.
public:
- // @@ Kirthika, please put this comment underneath the title()
+ // *done*@@ Kirthika, please put this comment underneath the title()
// method.
- // This is the abstract class method which describes the magazine.
void title (void);
+ // This is the abstract class method which describes the magazine.
};
# endif /* NEWSWEEK_H */
diff --git a/examples/DLL/Today.h b/examples/DLL/Today.h
index f315761bb61..d4cbe701932 100644
--- a/examples/DLL/Today.h
+++ b/examples/DLL/Today.h
@@ -1,5 +1,24 @@
+/* -*- C++ -*- */
// $Id$
+// ===========================================================
+//
+//
+// = LIBRARY
+// ACE_wrappers/examples/DLL
+//
+// = FILENAME
+// Today.h
+//
+// = DESCRIPTION
+// This class denotes the Today magazine which is derived from
+// Magazine.
+//
+// = AUTHOR
+// Kirthika Parameswaran <kirthika@cs.wustl.edu>
+//
+// ===========================================================
+
#ifndef TODAY_H
#define TODAY_H
@@ -16,15 +35,16 @@ class Today : public Magazine
// This is an derived class of Magazine.
//
// = DESCRIPTION
- // Polymoriphism is exploited and an object pointer
- // of Magazine is bound to the Today object at runtime.
+ // Polymoriphism is exploited and an object pointer of Magazine
+ // is bound to the Today object at runtime.
public:
- // @@ Kirthika, please put this comment underneath the title()
+ // *done*@@ Kirthika, please put this comment underneath the title()
// method. Also, please make the comment more descriptive.
- // The virtual abstract class method.
void title (void);
+ // The virtual abstract class method which returns the title of the
+ // magazine.
};
#endif /* TODAY_H */
diff --git a/examples/DLL/test_dll.cpp b/examples/DLL/test_dll.cpp
index 98cc1b893c9..be554b19e27 100644
--- a/examples/DLL/test_dll.cpp
+++ b/examples/DLL/test_dll.cpp
@@ -32,12 +32,14 @@ main (void)
dll.error ()),
-1);
{
+ //*done* cool. i realise what you did. You have added a scope that
+ // the auto_ptr deletes the magazine object.
// Kirthika, can you please use an auto_ptr here.
- Magazine *magazine = mc ();
+
+ auto_ptr <Magazine> magazine = mc ();
magazine->title ();
-
- delete magazine;
+
}
dll.close ();
@@ -58,14 +60,18 @@ main (void)
dll.error ()),
-1);
+ //*done*
// Kirthika, can you please use the trick of putting this inside of
// a bracketed expression and using auto_ptr on it as I showed
// above?
- magazine = mc ();
+
+ {
+
+ auto_ptr <Magazine> magazine = mc ();
- magazine->title ();
+ magazine->title ();
- delete magazine;
+ }
dll.close ();