Show
Ignore:
Timestamp:
03/21/12 18:36:20 (3 years ago)
Author:
robert
Message:

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osg/Stats

    r12056 r13041  
    1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2007 Robert Osfield  
     1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2007 Robert Osfield 
    22 * 
    3  * This library is open source and may be redistributed and/or modified under   
    4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or  
     3 * This library is open source and may be redistributed and/or modified under 
     4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
    55 * (at your option) any later version.  The full license is in LICENSE file 
    66 * included with this distribution, and on the openscenegraph.org website. 
    7  *  
     7 * 
    88 * This library is distributed in the hope that it will be useful, 
    99 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
     10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1111 * OpenSceneGraph Public License for more details. 
    1212*/ 
     
    3333 
    3434        Stats(const std::string& name, unsigned int numberOfFrames); 
    35          
     35 
    3636        void setName(const std::string& name) { _name = name; } 
    3737        const std::string& getName() const { return _name; } 
    38          
     38 
    3939        void allocate(unsigned int numberOfFrames); 
    40          
     40 
    4141        unsigned int getEarliestFrameNumber() const { return _latestFrameNumber < static_cast<unsigned int>(_attributeMapList.size()) ? 0 : _latestFrameNumber - static_cast<unsigned int>(_attributeMapList.size()) + 1; } 
    4242        unsigned int getLatestFrameNumber() const { return _latestFrameNumber; } 
    43          
     43 
    4444        typedef std::map<std::string, double> AttributeMap; 
    4545        typedef std::vector<AttributeMap> AttributeMapList; 
    4646 
    4747        bool setAttribute(unsigned int frameNumber, const std::string& attributeName, double value); 
    48          
     48 
    4949        inline bool getAttribute(unsigned int frameNumber, const std::string& attributeName, double& value) const 
    5050        { 
     
    5454 
    5555        bool getAveragedAttribute(const std::string& attributeName, double& value, bool averageInInverseSpace=false) const; 
    56          
     56 
    5757        bool getAveragedAttribute(unsigned int startFrameNumber, unsigned int endFrameNumber, const std::string& attributeName, double& value, bool averageInInverseSpace=false) const; 
    58          
     58 
    5959        inline AttributeMap& getAttributeMap(unsigned int frameNumber) 
    6060        { 
     
    6262            return getAttributeMapNoMutex(frameNumber); 
    6363        } 
    64          
     64 
    6565        inline const AttributeMap& getAttributeMap(unsigned int frameNumber) const 
    6666        { 
     
    6868            return getAttributeMapNoMutex(frameNumber); 
    6969        } 
    70          
     70 
    7171        typedef std::map<std::string, bool> CollectMap; 
    72          
     72 
    7373        void collectStats(const std::string& str, bool flag) { _collectMap[str] = flag; } 
    74          
     74 
    7575        inline bool collectStats(const std::string& str) const 
    7676        { 
    7777            OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex); 
    78              
    79             CollectMap::const_iterator itr = _collectMap.find(str);  
     78 
     79            CollectMap::const_iterator itr = _collectMap.find(str); 
    8080            return (itr !=  _collectMap.end()) ? itr->second : false; 
    8181        } 
     
    8383        void report(std::ostream& out, const char* indent=0) const; 
    8484        void report(std::ostream& out, unsigned int frameNumber, const char* indent=0) const; 
    85          
     85 
    8686    protected: 
    87      
     87 
    8888        virtual ~Stats() {} 
    89          
     89 
    9090        bool getAttributeNoMutex(unsigned int frameNumber, const std::string& attributeName, double& value) const; 
    9191 
     
    9898            // reject frame that are in the future 
    9999            if (frameNumber > _latestFrameNumber) return -1; 
    100              
     100 
    101101            // reject frames that are too early 
    102102            if (frameNumber < getEarliestFrameNumber()) return -1; 
    103              
     103 
    104104            if (frameNumber >= _baseFrameNumber) return frameNumber - _baseFrameNumber; 
    105105            else return static_cast<int>(_attributeMapList.size()) - (_baseFrameNumber-frameNumber); 
     
    107107 
    108108        std::string         _name; 
    109          
     109 
    110110        mutable OpenThreads::Mutex  _mutex; 
    111          
     111 
    112112        unsigned int        _baseFrameNumber; 
    113113        unsigned int        _latestFrameNumber; 
    114          
     114 
    115115        AttributeMapList    _attributeMapList; 
    116116        AttributeMap        _invalidAttributeMap; 
    117          
     117 
    118118        CollectMap          _collectMap; 
    119          
     119 
    120120}; 
    121121