class CachedSize
Defined at line 165 of file ../../third_party/protobuf/src/src/google/protobuf/message_lite.h
Allow easy change to regular int on platforms where the atomic might have a
perf impact.
CachedSize is like std::atomic
<int
> but with some important changes:
1) CachedSize uses Get / Set rather than load / store.
2) CachedSize always uses relaxed ordering.
3) CachedSize is assignable and copy-constructible.
4) CachedSize has a constexpr default constructor, and a constexpr
constructor that takes an int argument.
5) If the compiler supports the __atomic_load_n / __atomic_store_n builtins,
then CachedSize is trivially copyable.
Developed at https://godbolt.org/z/vYcx7zYs1 ; supports gcc, clang, MSVC.
Public Methods
void CachedSize ()
Defined at line 170 of file ../../third_party/protobuf/src/src/google/protobuf/message_lite.h
void CachedSize (Scalar desired)
NOLINTNEXTLINE(google-explicit-constructor)
Defined at line 172 of file ../../third_party/protobuf/src/src/google/protobuf/message_lite.h
void CachedSize (const CachedSize & other)
Defined at line 175 of file ../../third_party/protobuf/src/src/google/protobuf/message_lite.h
Scalar Get ()
Defined at line 177 of file ../../third_party/protobuf/src/src/google/protobuf/message_lite.h
void Set (Scalar desired)
Defined at line 181 of file ../../third_party/protobuf/src/src/google/protobuf/message_lite.h
void SetNonZero (Scalar desired)
Defined at line 190 of file ../../third_party/protobuf/src/src/google/protobuf/message_lite.h
void SetNoDefaultInstance (Scalar desired)
Defined at line 195 of file ../../third_party/protobuf/src/src/google/protobuf/message_lite.h