view_mode.h

説明を見る。
00001 // -*-c++-*-
00002 
00008 /*
00009  *Copyright:
00010 
00011  Copyright (C) Hidehisa AKIYAMA
00012 
00013  This code is free software; you can redistribute it and/or
00014  modify it under the terms of the GNU Lesser General Public
00015  License as published by the Free Software Foundation; either
00016  version 2.1 of the License, or (at your option) any later version.
00017 
00018  This library is distributed in the hope that it will be useful,
00019  but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021  Lesser General Public License for more details.
00022 
00023  You should have received a copy of the GNU Lesser General Public
00024  License along with this library; if not, write to the Free Software
00025  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00026 
00027  *EndCopyright:
00028  */
00029 
00031 
00032 #ifndef RCSC_PLAYER_VIEW_MODE_H
00033 #define RCSC_PLAYER_VIEW_MODE_H
00034 
00035 #include <string>
00036 
00037 namespace rcsc {
00038 
00043 class ViewWidth {
00044 public:
00048     enum Type {
00049         NARROW,
00050         NORMAL,
00051         WIDE,
00052         ILLEGAL
00053     };
00054 
00055 private:
00057     Type M_type;
00058 
00059 public:
00063     ViewWidth()
00064         : M_type( ViewWidth::NORMAL )
00065       { }
00070     ViewWidth( const ViewWidth::Type t )
00071         : M_type( t )
00072       { }
00073 
00079     ViewWidth & operator=( const ViewWidth::Type t )
00080       {
00081           M_type = t;
00082           return *this;
00083       }
00084 
00089     operator ViewWidth::Type() const
00090       {
00091           return M_type;
00092       }
00093 
00098     ViewWidth::Type type() const
00099       {
00100           return M_type;
00101       }
00102 
00110     bool operator==( const ViewWidth & w ) const
00111       {
00112           return this->type() == w.type();
00113       }
00114 
00120     bool operator==( const ViewWidth::Type t ) const
00121       {
00122           return this->type() == t;
00123       }
00124 
00132     bool operator!=( const ViewWidth & w ) const
00133       {
00134           return this->type() != w.type();
00135       }
00136 
00142     bool operator!=( const ViewWidth::Type t ) const
00143       {
00144           return this->type() != t;
00145       }
00146 
00151     const
00152     ViewWidth & operator++();
00153 
00158     const
00159     ViewWidth operator++( int );
00160 
00165     const
00166     ViewWidth & operator--();
00167 
00172     const
00173     ViewWidth operator--( int );
00174 
00179     double width() const
00180       {
00181           return width( this->type() );
00182       }
00183 
00188     std::string str() const;
00189 
00195     static
00196     double width( const ViewWidth::Type type );
00197 
00203     static
00204     ViewWidth::Type parse( const char * msg );
00205 };
00206 
00207 
00211 
00216 class ViewQuality {
00217 public:
00218     /*
00219       \brief types of view quality
00220     */
00221     enum Type {
00222         HIGH,
00223         LOW,
00224         ILLEGAL
00225     };
00226 
00227 private:
00229     Type M_type;
00230 
00231 public:
00235     ViewQuality()
00236         : M_type( ViewQuality::HIGH )
00237       { }
00238 
00243     ViewQuality( const ViewQuality::Type t )
00244         : M_type( t )
00245       { }
00246 
00252     ViewQuality & operator=( const ViewQuality::Type t )
00253       {
00254           M_type = t;
00255           return *this;
00256       }
00257 
00262     operator ViewQuality::Type() const
00263       {
00264           return M_type;
00265       }
00266 
00271     ViewQuality::Type type() const
00272       {
00273           return M_type;
00274       }
00275 
00283     bool operator==( const ViewQuality & q ) const
00284       {
00285           return this->type() == q.type();
00286       }
00287 
00293     bool operator==( const ViewQuality::Type t ) const
00294       {
00295           return this->type() == t;
00296       }
00297 
00305     bool operator!=( const ViewQuality & q ) const
00306       {
00307           return this->type() != q.type();
00308       }
00309 
00315     bool operator!=( const ViewQuality::Type& t ) const
00316       {
00317           return this->type() != t;
00318       }
00319 
00324 
00325     std::string str() const;
00326 
00332     static
00333     ViewQuality::Type parse( const char * msg );
00334 };
00335 
00336 }
00337 
00338 #endif

librcscに対してThu May 1 15:41:21 2008に生成されました。  doxygen 1.5.0