text.hh revision 8514
1695SN/A/* 21762SN/A * Copyright (c) 2004-2005 The Regents of The University of Michigan 3695SN/A * All rights reserved. 4695SN/A * 5695SN/A * Redistribution and use in source and binary forms, with or without 6695SN/A * modification, are permitted provided that the following conditions are 7695SN/A * met: redistributions of source code must retain the above copyright 8695SN/A * notice, this list of conditions and the following disclaimer; 9695SN/A * redistributions in binary form must reproduce the above copyright 10695SN/A * notice, this list of conditions and the following disclaimer in the 11695SN/A * documentation and/or other materials provided with the distribution; 12695SN/A * neither the name of the copyright holders nor the names of its 13695SN/A * contributors may be used to endorse or promote products derived from 14695SN/A * this software without specific prior written permission. 15695SN/A * 16695SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17695SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18695SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19695SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20695SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21695SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22695SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23695SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24695SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25695SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26695SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272665Ssaidi@eecs.umich.edu * 282665Ssaidi@eecs.umich.edu * Authors: Nathan Binkert 29695SN/A */ 30695SN/A 31695SN/A#ifndef __BASE_STATS_TEXT_HH__ 32695SN/A#define __BASE_STATS_TEXT_HH__ 33695SN/A 34695SN/A#include <iosfwd> 35695SN/A#include <string> 36695SN/A 378229Snate@binkert.org#include "base/stats/output.hh" 384078Sbinkertn@umich.edu#include "base/output.hh" 39695SN/A 40729SN/Anamespace Stats { 41695SN/A 42695SN/Aclass Text : public Output 43695SN/A{ 44695SN/A protected: 45695SN/A bool mystream; 46695SN/A std::ostream *stream; 47695SN/A 48695SN/A protected: 495886Snate@binkert.org bool noOutput(const Info &info); 50695SN/A 51695SN/A public: 52695SN/A bool descriptions; 53695SN/A 54695SN/A public: 55695SN/A Text(); 56695SN/A Text(std::ostream &stream); 57695SN/A Text(const std::string &file); 58695SN/A ~Text(); 59695SN/A 60695SN/A void open(std::ostream &stream); 61695SN/A void open(const std::string &file); 62695SN/A 63695SN/A // Implement Visit 646128Snate@binkert.org virtual void visit(const ScalarInfo &info); 656128Snate@binkert.org virtual void visit(const VectorInfo &info); 666128Snate@binkert.org virtual void visit(const DistInfo &info); 676128Snate@binkert.org virtual void visit(const VectorDistInfo &info); 686128Snate@binkert.org virtual void visit(const Vector2dInfo &info); 696128Snate@binkert.org virtual void visit(const FormulaInfo &info); 708514SThomas.Grass@ARM.com virtual void visit(const SparseHistInfo &info); 71695SN/A 72695SN/A // Implement Output 73695SN/A virtual bool valid() const; 748296Snate@binkert.org virtual void begin(); 758296Snate@binkert.org virtual void end(); 76695SN/A}; 77695SN/A 788296Snate@binkert.orgOutput *initText(const std::string &filename, bool desc); 794078Sbinkertn@umich.edu 807811Ssteve.reinhardt@amd.com} // namespace Stats 81695SN/A 82695SN/A#endif // __BASE_STATS_TEXT_HH__ 83