OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::UndoRedo::MutableHistoryInterval Struct Reference
Collaboration diagram for Slic3r::UndoRedo::MutableHistoryInterval:

Classes

struct  Data

Public Member Functions

 MutableHistoryInterval (const Interval &interval, const std::string &input_data)
 MutableHistoryInterval (const Interval &interval, MutableHistoryInterval &other)
 MutableHistoryInterval (const size_t begin, const size_t end)
 MutableHistoryInterval (MutableHistoryInterval &&rhs)
MutableHistoryInterval & operator= (MutableHistoryInterval &&rhs)
 ~MutableHistoryInterval ()
const Interval & interval () const
size_t begin () const
size_t end () const
void trim_begin (size_t timestamp)
void trim_end (size_t timestamp)
void extend_begin (size_t timestamp)
void extend_end (size_t timestamp)
bool operator< (const MutableHistoryInterval &rhs) const
bool operator== (const MutableHistoryInterval &rhs) const
const char * data () const
size_t size () const
size_t refcnt () const
bool matches (const std::string &data)
bool matches_timestamp (uint64_t timestamp)
size_t memsize () const

Private Member Functions

 MutableHistoryInterval (const MutableHistoryInterval &rhs)
MutableHistoryInterval & operator= (const MutableHistoryInterval &rhs)

Private Attributes

Interval m_interval
Data * m_data

Detailed Description

Constructor & Destructor Documentation

◆ MutableHistoryInterval() [1/5]

Slic3r::UndoRedo::MutableHistoryInterval::MutableHistoryInterval ( const Interval & interval,
const std::string & input_data )
inline
370 : m_interval(interval), m_data(nullptr) {
371 m_data = (Data*)new char[offsetof(Data, data) + input_data.size()];
372 m_data->refcnt = 1;
373 m_data->size = input_data.size();
374 memcpy(m_data->data, input_data.data(), input_data.size());
375 }
Data * m_data
Definition UndoRedo.cpp:367
const Interval & interval() const
Definition UndoRedo.cpp:392
const char * data() const
Definition UndoRedo.cpp:403
Interval m_interval
Definition UndoRedo.cpp:366

References data(), interval(), m_data, and m_interval.

Referenced by MutableHistoryInterval(), MutableHistoryInterval(), MutableHistoryInterval(), operator<(), operator=(), operator=(), and operator==().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MutableHistoryInterval() [2/5]

Slic3r::UndoRedo::MutableHistoryInterval::MutableHistoryInterval ( const Interval & interval,
MutableHistoryInterval & other )
inline
377 : m_interval(interval), m_data(other.m_data) {
378 ++ m_data->refcnt;
379 }

References MutableHistoryInterval(), interval(), m_data, and m_interval.

Here is the call graph for this function:

◆ MutableHistoryInterval() [3/5]

Slic3r::UndoRedo::MutableHistoryInterval::MutableHistoryInterval ( const size_t begin,
const size_t end )
inline
382: m_interval(begin, end), m_data(nullptr) {}
size_t begin() const
Definition UndoRedo.cpp:393
size_t end() const
Definition UndoRedo.cpp:394

References begin(), end(), m_data, and m_interval.

Here is the call graph for this function:

◆ MutableHistoryInterval() [4/5]

Slic3r::UndoRedo::MutableHistoryInterval::MutableHistoryInterval ( MutableHistoryInterval && rhs)
inline
384: m_interval(rhs.m_interval), m_data(rhs.m_data) { rhs.m_data = nullptr; }

References MutableHistoryInterval(), m_data, and m_interval.

Here is the call graph for this function:

◆ ~MutableHistoryInterval()

Slic3r::UndoRedo::MutableHistoryInterval::~MutableHistoryInterval ( )
inline
387 {
388 if (m_data != nullptr && -- m_data->refcnt == 0)
389 delete[] (char*)m_data;
390 }

References m_data.

◆ MutableHistoryInterval() [5/5]

Slic3r::UndoRedo::MutableHistoryInterval::MutableHistoryInterval ( const MutableHistoryInterval & rhs)
private

References MutableHistoryInterval().

Here is the call graph for this function:

Member Function Documentation

◆ begin()

size_t Slic3r::UndoRedo::MutableHistoryInterval::begin ( ) const
inline
393{ return m_interval.begin(); }

References m_interval.

Referenced by MutableHistoryInterval().

Here is the caller graph for this function:

◆ data()

const char * Slic3r::UndoRedo::MutableHistoryInterval::data ( ) const
inline
403{ return m_data->data; }

References m_data.

Referenced by MutableHistoryInterval(), and matches().

Here is the caller graph for this function:

◆ end()

size_t Slic3r::UndoRedo::MutableHistoryInterval::end ( ) const
inline
394{ return m_interval.end(); }

References m_interval.

Referenced by MutableHistoryInterval().

Here is the caller graph for this function:

◆ extend_begin()

void Slic3r::UndoRedo::MutableHistoryInterval::extend_begin ( size_t timestamp)
inline
397{ m_interval.extend_begin(timestamp); }

References m_interval.

◆ extend_end()

void Slic3r::UndoRedo::MutableHistoryInterval::extend_end ( size_t timestamp)
inline
398{ m_interval.extend_end(timestamp); }

References m_interval.

◆ interval()

const Interval & Slic3r::UndoRedo::MutableHistoryInterval::interval ( ) const
inline
392{ return m_interval; }

References m_interval.

Referenced by MutableHistoryInterval(), and MutableHistoryInterval().

Here is the caller graph for this function:

◆ matches()

bool Slic3r::UndoRedo::MutableHistoryInterval::matches ( const std::string & data)
inline
406{ return m_data->matches(data); }

References data(), and m_data.

Here is the call graph for this function:

◆ matches_timestamp()

bool Slic3r::UndoRedo::MutableHistoryInterval::matches_timestamp ( uint64_t timestamp)
inline
407{ return m_data->matches_timestamp(timestamp); }

References m_data.

◆ memsize()

size_t Slic3r::UndoRedo::MutableHistoryInterval::memsize ( ) const
inline
408 {
409 return m_data->refcnt == 1 ?
410 // Count just the size of the snapshot data.
411 m_data->size :
412 // Count the size of the snapshot data divided by the number of references, rounded up.
413 (m_data->size + m_data->refcnt - 1) / m_data->refcnt;
414 }

References m_data.

◆ operator<()

bool Slic3r::UndoRedo::MutableHistoryInterval::operator< ( const MutableHistoryInterval & rhs) const
inline
400{ return m_interval < rhs.m_interval; }

References MutableHistoryInterval(), and m_interval.

Here is the call graph for this function:

◆ operator=() [1/2]

MutableHistoryInterval & Slic3r::UndoRedo::MutableHistoryInterval::operator= ( const MutableHistoryInterval & rhs)
private

References MutableHistoryInterval().

Here is the call graph for this function:

◆ operator=() [2/2]

MutableHistoryInterval & Slic3r::UndoRedo::MutableHistoryInterval::operator= ( MutableHistoryInterval && rhs)
inline
385{ m_interval = rhs.m_interval; m_data = rhs.m_data; rhs.m_data = nullptr; return *this; }

References MutableHistoryInterval(), m_data, and m_interval.

Here is the call graph for this function:

◆ operator==()

bool Slic3r::UndoRedo::MutableHistoryInterval::operator== ( const MutableHistoryInterval & rhs) const
inline
401{ return m_interval == rhs.m_interval; }

References MutableHistoryInterval(), and m_interval.

Here is the call graph for this function:

◆ refcnt()

size_t Slic3r::UndoRedo::MutableHistoryInterval::refcnt ( ) const
inline
405{ return m_data->refcnt; }

References m_data.

◆ size()

size_t Slic3r::UndoRedo::MutableHistoryInterval::size ( ) const
inline
404{ return m_data->size; }

References m_data.

◆ trim_begin()

void Slic3r::UndoRedo::MutableHistoryInterval::trim_begin ( size_t timestamp)
inline
395{ m_interval.trim_begin(timestamp); }

References m_interval.

◆ trim_end()

void Slic3r::UndoRedo::MutableHistoryInterval::trim_end ( size_t timestamp)
inline
396{ m_interval.trim_end(timestamp); }

References m_interval.

Member Data Documentation

◆ m_data

◆ m_interval


The documentation for this struct was generated from the following file:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/Utils/UndoRedo.cpp