Panda3D
|
00001 // Filename: rangeDescription.I 00002 // Created by: drose (07Sep03) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: RangeDescription::add_singleton 00018 // Access: Public 00019 // Description: 00020 //////////////////////////////////////////////////////////////////// 00021 INLINE void RangeDescription:: 00022 add_singleton(int code) { 00023 _range_list.push_back(Range(code)); 00024 } 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Function: RangeDescription::add_range 00028 // Access: Public 00029 // Description: 00030 //////////////////////////////////////////////////////////////////// 00031 INLINE void RangeDescription:: 00032 add_range(int from_code, int to_code) { 00033 _range_list.push_back(Range(from_code, to_code)); 00034 } 00035 00036 //////////////////////////////////////////////////////////////////// 00037 // Function: RangeDescription::is_empty 00038 // Access: Public 00039 // Description: Returns true if there are no codes described in the 00040 // range. 00041 //////////////////////////////////////////////////////////////////// 00042 INLINE bool RangeDescription:: 00043 is_empty() const { 00044 return _range_list.empty(); 00045 } 00046 00047 //////////////////////////////////////////////////////////////////// 00048 // Function: RangeDescription::Range::Constructor 00049 // Access: Public 00050 // Description: 00051 //////////////////////////////////////////////////////////////////// 00052 INLINE RangeDescription::Range:: 00053 Range(int code) : 00054 _from_code(code), 00055 _to_code(code) 00056 { 00057 } 00058 00059 //////////////////////////////////////////////////////////////////// 00060 // Function: RangeDescription::Range::Constructor 00061 // Access: Public 00062 // Description: 00063 //////////////////////////////////////////////////////////////////// 00064 INLINE RangeDescription::Range:: 00065 Range(int from_code, int to_code) : 00066 _from_code(from_code), 00067 _to_code(to_code) 00068 { 00069 } 00070 00071 INLINE ostream &operator << (ostream &out, const RangeDescription &range) { 00072 range.output(out); 00073 return out; 00074 }