OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_GFX_POINT_BASE_H_ | 5 #ifndef UI_GFX_POINT_BASE_H_ |
6 #define UI_GFX_POINT_BASE_H_ | 6 #define UI_GFX_POINT_BASE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // the x-value closer to the origin is considered less than the | 73 // the x-value closer to the origin is considered less than the |
74 // other. | 74 // other. |
75 // This comparison is required to use Point in sets, or sorted | 75 // This comparison is required to use Point in sets, or sorted |
76 // vectors. | 76 // vectors. |
77 bool operator<(const Class& rhs) const { | 77 bool operator<(const Class& rhs) const { |
78 return (y_ == rhs.y_) ? (x_ < rhs.x_) : (y_ < rhs.y_); | 78 return (y_ == rhs.y_) ? (x_ < rhs.x_) : (y_ < rhs.y_); |
79 } | 79 } |
80 | 80 |
81 protected: | 81 protected: |
82 PointBase(Type x, Type y) : x_(x), y_(y) {} | 82 PointBase(Type x, Type y) : x_(x), y_(y) {} |
83 virtual ~PointBase() {} | 83 // Destructor is intentionally made non virtual and protected. |
| 84 // Do not make this public. |
| 85 ~PointBase() {} |
84 | 86 |
85 private: | 87 private: |
86 Type x_; | 88 Type x_; |
87 Type y_; | 89 Type y_; |
88 }; | 90 }; |
89 | 91 |
90 } // namespace gfx | 92 } // namespace gfx |
91 | 93 |
92 #endif // UI_GFX_POINT_BASE_H_ | 94 #endif // UI_GFX_POINT_BASE_H_ |
OLD | NEW |