AbstractCacheEntry.hh revision 6145:15cca6ab723a
12497SN/A 210719SMarco.Balboni@ARM.com/* 38711SN/A * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 48711SN/A * All rights reserved. 58711SN/A * 68711SN/A * Redistribution and use in source and binary forms, with or without 78711SN/A * modification, are permitted provided that the following conditions are 88711SN/A * met: redistributions of source code must retain the above copyright 98711SN/A * notice, this list of conditions and the following disclaimer; 108711SN/A * redistributions in binary form must reproduce the above copyright 118711SN/A * notice, this list of conditions and the following disclaimer in the 128711SN/A * documentation and/or other materials provided with the distribution; 138711SN/A * neither the name of the copyright holders nor the names of its 142497SN/A * contributors may be used to endorse or promote products derived from 152497SN/A * this software without specific prior written permission. 162497SN/A * 172497SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 182497SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 192497SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 202497SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 212497SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 222497SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 232497SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 242497SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 252497SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 262497SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 272497SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 282497SN/A */ 292497SN/A 302497SN/A/* 312497SN/A * $Id$ 322497SN/A * 332497SN/A * Description: Common base class for a machine node. 342497SN/A * 352497SN/A */ 362497SN/A 372497SN/A#ifndef AbstractCacheEntry_H 382497SN/A#define AbstractCacheEntry_H 392665SN/A 402665SN/A#include "Global.hh" 418715SN/A#include "Address.hh" 428922SN/A#include "AccessPermission.hh" 432497SN/A 442497SN/Aclass AbstractCacheEntry { 452497SN/Apublic: 462982SN/A // Constructors 4710405Sandreas.hansson@arm.com AbstractCacheEntry(); 482497SN/A 492497SN/A // Destructor, prevent it from instantiation 502846SN/A virtual ~AbstractCacheEntry() = 0; 512548SN/A 5210405Sandreas.hansson@arm.com // Public Methods 5310405Sandreas.hansson@arm.com 5410405Sandreas.hansson@arm.com // The methods below are those called by ruby runtime, add when it is 559524SN/A // absolutely necessary and should all be virtual function. 562497SN/A 5710405Sandreas.hansson@arm.com 5810719SMarco.Balboni@ARM.com virtual void print(ostream& out) const = 0; 5911334Sandreas.hansson@arm.com 6011334Sandreas.hansson@arm.com // Data Members (m_ prefix) 617523SN/A Address m_Address; // Address of this block, required by CacheMemory 628851SN/A Time m_LastRef; // Last time this block was referenced, required by CacheMemory 638948SN/A AccessPermission m_Permission; // Access permission for this block, required by CacheMemory 648948SN/A}; 658851SN/A 669095SN/A// Output operator declaration 6710405Sandreas.hansson@arm.comostream& operator<<(ostream& out, const AbstractCacheEntry& obj); 688922SN/A 699715SN/A// ******************* Definitions ******************* 709715SN/A 7110713Sandreas.hansson@arm.com// Output operator definition 7210713Sandreas.hansson@arm.comextern inline 738851SN/Aostream& operator<<(ostream& out, const AbstractCacheEntry& obj) 748851SN/A{ 758948SN/A obj.print(out); 768948SN/A out << flush; 778915SN/A return out; 789031SN/A} 799095SN/A 8010405Sandreas.hansson@arm.com#endif //AbstractCacheEntry_H 819036SN/A 828922SN/A