summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-05-22 02:01:35 +0000
committerjxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-05-22 02:01:35 +0000
commit3fbb6964c5308abaebf76ae9d169f17470aa6724 (patch)
tree13d0e20cfe9a99f17fc696b9ccc09cf72bc9b295
parent7c387f15628fc4b2d9ccf9f6e5e181cb6ba5a8d8 (diff)
downloadATCD-3fbb6964c5308abaebf76ae9d169f17470aa6724.tar.gz
Added some comments.
-rw-r--r--apps/JAWS/server/JAWS_File.cpp15
-rw-r--r--apps/JAWS/server/JAWS_File.h7
2 files changed, 13 insertions, 9 deletions
diff --git a/apps/JAWS/server/JAWS_File.cpp b/apps/JAWS/server/JAWS_File.cpp
index a0d2d62567a..a8241bbaf02 100644
--- a/apps/JAWS/server/JAWS_File.cpp
+++ b/apps/JAWS/server/JAWS_File.cpp
@@ -37,18 +37,16 @@ JAWS_File_Handle::vfs_ = JAWS_Virtual_Filesystem::instance ();
JAWS_Virtual_Filesystem * JAWS_Virtual_Filesystem::cvf_ = 0;
ACE_SYNCH_MUTEX JAWS_Virtual_Filesystem::lock_;
+// this is how you make data opaque in C++
+// I'd like to do this with JAWS_File too, but Doug would pro'ly kill me
class JAWS_Virtual_Filesystem_Singleton
{
public:
JAWS_Virtual_Filesystem_Singleton (void)
- {
- this->singleton_ = JAWS_Virtual_Filesystem::instance ();
- }
+ { this->singleton_ = JAWS_Virtual_Filesystem::instance (); }
~JAWS_Virtual_Filesystem_Singleton (void)
- {
- delete this->singleton_;
- }
+ { delete this->singleton_; }
private:
JAWS_Virtual_Filesystem * singleton_;
@@ -91,18 +89,23 @@ JAWS_File_Handle::~JAWS_File_Handle (void)
{
if (this->handle_ != ACE_INVALID_HANDLE)
{
+ // this was dup ()'d
ACE_OS::close (this->handle_);
}
+
if (this->file_ != 0)
{
switch (this->file_->action ())
{
case JAWS_File::WRITING:
this->file_->release ();
+ // assert (this->file_->reference_count () == 0);
+ // put it into the CVF
this->vfs_->replace (this->file_);
break;
case JAWS_File::WAITING:
+ // last one using a stale file is resposible for deleting it
if (this->file_->release () == 0)
delete this->file_;
break;
diff --git a/apps/JAWS/server/JAWS_File.h b/apps/JAWS/server/JAWS_File.h
index 318f408e0fc..a327b57c444 100644
--- a/apps/JAWS/server/JAWS_File.h
+++ b/apps/JAWS/server/JAWS_File.h
@@ -35,7 +35,7 @@ class JAWS_File_Handle
// E.g. 1,
// {
// JAWS_File_Handle foo("foo.html");
- // this->peer ().send (foo.file ().map (), foo.file ().size ());
+ // this->peer ().send (foo.address (), foo.size ());
// }
// E.g. 2,
@@ -47,7 +47,7 @@ class JAWS_File_Handle
// E.g. 3,
// {
// JAWS_File_Handle foo("foo.html", content_length);
- // this->peer ().recv (foo.map (), content_length);
+ // this->peer ().recv (foo.address (), content_length);
// }
{
public:
@@ -142,7 +142,8 @@ private:
class JAWS_File
// = TITLE
// Abstraction over a real file. This is what the Virtual Filesystem
- // contains.
+ // contains. This class is not intended for general consumption.
+ // Please consult a physician before attempting to use this class.
{
public: