libUTL++
Int.h
1 #pragma once
2 
4 
5 #include <libutl/Integer.h>
6 
8 
9 UTL_NS_BEGIN;
10 
12 
20 
22 class Int : public Integer<int64_t>
23 {
26 
27 public:
33  : Integer<int64_t>(i)
34  {
35  }
36 
41  Int(const String& str)
42  {
43  set(str);
44  }
45 
46  virtual void serialize(Stream& stream, uint_t io, uint_t mode = ser_default);
47 
49  Int
50  abs() const
51  {
52  return Int(::abs(_n));
53  }
54 };
55 
57 
58 UTL_NS_END;
#define UTL_CLASS_DEFID
Default init() and deInit() (which are merely place-holders).
Definition: macros.h:532
void serialize(bool &b, Stream &stream, uint_t io, uint_t mode=ser_default)
Serialize a boolean.
32-bit signed integer.
Definition: Int.h:22
default representation (via getSerializeMode())
Definition: util.h:75
#define UTL_CLASS_DECL(DC, BC)
Declaration of standard UTL++ functionality for a non-template class.
Definition: macros.h:688
Character string.
Definition: String.h:31
long int64_t
Signed 64-bit integer.
Definition: types.h:164
Integer value.
Definition: Integer.h:23
unsigned int uint_t
Unsigned integer.
Definition: types.h:59
Int(int64_t i)
Constructor.
Definition: Int.h:32
Stream I/O abstraction.
Definition: Stream.h:68
Int abs() const
Get the absolute value of self.
Definition: Int.h:50
Int(const String &str)
Constructor.
Definition: Int.h:41