Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

pageframe.h

Go to the documentation of this file.
00001 
00007 /*
00008  *  Copyright (C) 2004,2005 Bregmasoft
00009  * 
00010  * This program is free software; you can redistribute it and/or modify it under
00011  * the terms of the GNU General Public License as published by the Free Software
00012  * Foundation; either version 2 of the License, or (at your option) any later
00013  * version.
00014  * 
00015  * This program is distributed in the hope that it will be useful, but WITHOUT ANY
00016  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
00017  * PARTICULAR PURPOSE. See the GNU General Public License for more details.
00018  * 
00019  * You should have received a copy of the GNU General Public License along with
00020  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021  * Place, Suite 330, Boston, MA 02111-1307 USA
00022  */
00023 #ifndef ZYGOMA_PAGEFRAME_H_ 
00024 #define ZYGOMA_PAGEFRAME_H_ 
00025 
00026 #include "config.h"
00027 
00028 namespace Zygoma
00029 {
00039   class PageFrame
00040   {
00041   public:
00042 
00046     PageFrame()
00047     : m_owningTaskId(0)
00048     , m_isLocked(false)
00049     , m_isInvalid(false)
00050     , m_stats(0)
00051     { }
00052 
00056     ~PageFrame()
00057     { }
00058 
00064     unsigned int
00065     owningTaskId() const
00066     { return m_owningTaskId; }
00067 
00073     void
00074     setOwningTaskId(unsigned int taskId)
00075     { m_owningTaskId = taskId; }
00076 
00082     bool
00083     isLocked() const
00084     { return m_isLocked; }
00085 
00089     void
00090     lock()
00091     { m_isLocked = true; }
00092 
00096     void
00097     unlock()
00098     { m_isLocked = false; }
00099 
00105     bool
00106     isValid() const
00107     { return m_isInvalid == false; }
00108     
00112     void
00113     invalidate()
00114     { m_isInvalid = true; }
00115 
00116   private:
00117     PageFrame(const PageFrame&);
00118     PageFrame& operator=(const PageFrame&);
00119 
00120   private:
00121     unsigned int m_owningTaskId: 14;
00122     bool         m_isLocked:      1;
00123     bool         m_isInvalid:     1;
00124     unsigned int m_stats:        16;
00125   } ZYGOMA_PACKED;
00126 } // namespace Zygoma
00127 
00128 #endif // ZYGOMA_PAGEFRAME_H_ 

Generated on Fri Sep 2 10:44:36 2005 for zygoma by doxygen 1.4.2