1#ifndef ROSE_BinaryAnalysis_Alignment_H
2#define ROSE_BinaryAnalysis_Alignment_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
6#include <Sawyer/Optional.h>
8#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
9#include <boost/serialization/access.hpp>
13namespace BinaryAnalysis {
21#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
23 friend class boost::serialization::access;
26 void serialize(S &s,
const unsigned ) {
27 s & BOOST_SERIALIZATION_NVP(value_);
28 s & BOOST_SERIALIZATION_NVP(nBits_);
Information about alignments.
bool isAligned(uint64_t) const
Test whether a value is aligned.
uint64_t operator*() const
Property: Alignment.
void nBits(size_t)
Property: Number of bits in the values being aligned.
Alignment & operator=(const uint64_t)
Assignment.
size_t nBits() const
Property: Number of bits in the values being aligned.
Alignment(uint64_t alignment, size_t nBits)
Constructor with specific alignment.
uint64_t get() const
Property: Alignment.
Alignment()
Default constructor.
uint64_t alignDown(uint64_t) const
Round value down to closest multiple of the alignment.
void set(uint64_t)
Property: Alignment.
Sawyer::Optional< uint64_t > alignUp(uint64_t) const
Round value up to the closest multiple of the alignment.
Alignment & operator=(const Alignment &)=default
Assignment.
Holds a value or nothing.