[BACK]Return to DirEntry.h CVS log [TXT][DIR] Up to [Development] / fam / fam

Annotation of fam/fam/DirEntry.h, Revision 1.1

1.1     ! trev        1: //  Copyright (C) 1999 Silicon Graphics, Inc.  All Rights Reserved.
        !             2: //
        !             3: //  This program is free software; you can redistribute it and/or modify it
        !             4: //  under the terms of version 2 of the GNU General Public License as
        !             5: //  published by the Free Software Foundation.
        !             6: //
        !             7: //  This program is distributed in the hope that it would be useful, but
        !             8: //  WITHOUT ANY WARRANTY; without even the implied warranty of
        !             9: //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  Further, any
        !            10: //  license provided herein, whether implied or otherwise, is limited to
        !            11: //  this program in accordance with the express provisions of the GNU
        !            12: //  General Public License.  Patent licenses, if any, provided herein do not
        !            13: //  apply to combinations of this program with other product or programs, or
        !            14: //  any other product whatsoever.  This program is distributed without any
        !            15: //  warranty that the program is delivered free of the rightful claim of any
        !            16: //  third person by way of infringement or the like.  See the GNU General
        !            17: //  Public License for more details.
        !            18: //
        !            19: //  You should have received a copy of the GNU General Public License along
        !            20: //  with this program; if not, write the Free Software Foundation, Inc., 59
        !            21: //  Temple Place - Suite 330, Boston MA 02111-1307, USA.
        !            22:
        !            23: #ifndef DirEntry_included
        !            24: #define DirEntry_included
        !            25:
        !            26: #include "Interest.h"
        !            27:
        !            28: class Directory;
        !            29:
        !            30: //  A DirEntry is a subclass of Interest that represents an entry
        !            31: //  in a Directory that a Client has expressed an interest in.
        !            32: //
        !            33: //  A DirEntry overrides a lot of Interest's methods and forwards
        !            34: //  them to its parent directory.
        !            35: //
        !            36: //  DirEntries are stored on a singly-linked list.  The head of the
        !            37: //  list is in the parent.  Each DirEntry also has a parent pointer.
        !            38: //  The entries in the list are in the order they're returned by
        !            39: //  readdir().
        !            40:
        !            41: class DirEntry : public Interest {
        !            42:
        !            43: public:
        !            44:
        !            45:     virtual bool active() const;
        !            46:     virtual bool scan(Interest * = 0);
        !            47:     virtual void scan_no_chdir();
        !            48:     virtual void unscan(Interest * = 0);
        !            49:     virtual bool do_scan();
        !            50:
        !            51: protected:
        !            52:
        !            53:     void post_event(const Event&, const char * = 0);
        !            54:
        !            55: private:
        !            56:
        !            57:     //  Instance Variables
        !            58:
        !            59:     Directory *const parent;
        !            60:     DirEntry *next;
        !            61:
        !            62:     bool need_to_chdir;
        !            63:
        !            64:     //  Private Instance Methods
        !            65:
        !            66:     DirEntry(const char *name, Directory *parent, DirEntry *next);
        !            67: 				// Only a Directory may create a DirEntry.
        !            68:     virtual ~DirEntry();
        !            69:
        !            70:     virtual void notify_created(Interest *);
        !            71:     virtual void notify_deleted(Interest *);
        !            72:
        !            73: friend class Directory;
        !            74: friend class DirectoryScanner;
        !            75:
        !            76: };
        !            77:
        !            78: #endif /* !DirEntry_included */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>