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

Annotation of fam/fam/ClientInterest.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 ClientInterest_included
        !            24: #define ClientInterest_included
        !            25:
        !            26: #include "Boolean.h"
        !            27: #include "Cred.h"
        !            28: #include "Interest.h"
        !            29: #include "Request.h"
        !            30:
        !            31: class Client;
        !            32:
        !            33: //  ClientInterest -- an abstract base class for a filesystem entity
        !            34: //  in which a client has expressed an interest.  The two kinds of
        !            35: //  ClientInterest are File and Directory.
        !            36: //
        !            37: //  The ClientInterest is intimately tied to the Interest, Directory
        !            38: //  and DirEntry.  And the whole hierarchy is very messy.
        !            39:
        !            40: class ClientInterest : public Interest {
        !            41:
        !            42: public:
        !            43:
        !            44:     enum Type { FILE = 'W', DIRECTORY = 'M' };
        !            45:
        !            46:     virtual ~ClientInterest();
        !            47:
        !            48:     virtual void suspend();
        !            49:     virtual void resume();
        !            50:     virtual bool active() const;
        !            51:
        !            52:     void findfilesystem();
        !            53:     bool scan(Interest * = NULL);
        !            54:     void unscan(Interest * = NULL);
        !            55:     virtual Interest *find_name(const char *);
        !            56:     virtual bool do_scan();
        !            57:
        !            58:     void become_user() const		{ mycred.become_user(); }
        !            59:     const Cred& cred() const		{ return mycred; }
        !            60:     FileSystem *filesystem() const	{ return myfilesystem; }
        !            61:     Client *client() const		{ return myclient; }
        !            62:     virtual Type type() const = 0;
        !            63:
        !            64:     virtual void notify_created(Interest *);
        !            65:     virtual void notify_deleted(Interest *);
        !            66:
        !            67:     virtual void cancel();
        !            68:
        !            69: protected:
        !            70:
        !            71:     ClientInterest(const char *name, Client *, Request, const Cred&, Type);
        !            72:     void post_event(const Event&, const char * = NULL);
        !            73:
        !            74: private:
        !            75:
        !            76:     enum { ACTIVE_STATE = 1 << 0 };
        !            77:
        !            78:     //  Instance Variables
        !            79:
        !            80:     Client *myclient;
        !            81:     Request request;
        !            82:     const Cred mycred;
        !            83:     FileSystem *myfilesystem;
        !            84:     Request fs_request;
        !            85:
        !            86:     void filesystem(FileSystem *);
        !            87:
        !            88: };
        !            89:
        !            90: #endif /* !ClientInterest_included */

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