Halide 22.0.0 Halide compiler and libraries

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Halide::Runtime::Internal::StringStorage Class Reference

`#include <string_storage.h>`

## Public Member Functions
| StringStorage (void *user_context=nullptr, uint32_t capacity=0, const SystemMemoryAllocatorFns &sma=default_allocator())
| StringStorage (const StringStorage &other)=default
| ~StringStorage ()
void | initialize (void *user_context, uint32_t capacity=0, const SystemMemoryAllocatorFns &sma=default_allocator())
void | destroy (void *user_context)
StringStorage & | operator= (const StringStorage &other)
bool | operator== (const StringStorage &other) const
bool | operator!= (const StringStorage &other) const
bool | contains (const char *str) const
bool | contains (const StringStorage &other) const
void | reserve (void *user_context, size_t length)
void | assign (void *user_context, char ch)
void | assign (void *user_context, const char *str, size_t length=0)
void | append (void *user_context, char ch)
void | append (void *user_context, const char *str, size_t length=0)
void | prepend (void *user_context, char ch)
void | prepend (void *user_context, const char *str, size_t length=0)
void | clear (void *user_context)
void | terminate (void *user_context, size_t length)
size_t | length () const
const char * | data () const
const SystemMemoryAllocatorFns & | current_allocator () const

## Static Public Member Functions
static StringStorage * | create (void *user_context, const SystemMemoryAllocatorFns &ma)
static void | destroy (void *user_context, StringStorage *string_storage)
static const SystemMemoryAllocatorFns & | default_allocator ()

## Detailed Description

Definition at line 84 of file string_storage.h.

## Constructor & Destructor Documentation

## ◆ StringStorage() [1/2]

Halide::Runtime::Internal::StringStorage::StringStorage | ( | void * | user_context = `nullptr`,
|  | uint32_t | capacity = `0`,
|  | const SystemMemoryAllocatorFns & | sma = `default_allocator()`
| ) |  |
| explicit

Definition at line 124 of file string_storage.h.

References Halide::cast().

## ◆ StringStorage() [2/2]

Halide::Runtime::Internal::StringStorage::StringStorage | ( | const StringStorage & | other | ) |
| default

## ◆ ~StringStorage()

Halide::Runtime::Internal::StringStorage::~StringStorage | ( |  | ) |

Definition at line 131 of file string_storage.h.

References destroy().

## Member Function Documentation

## ◆ create()

StringStorage * Halide::Runtime::Internal::StringStorage::create | ( | void * | user_context,
|  | const SystemMemoryAllocatorFns & | ma
| ) |  |
| static

Definition at line 135 of file string_storage.h.

References Halide::cast(), halide_abort_if_false, halide_error(), initialize(), and user_context.

Referenced by Halide::Runtime::Internal::StringTable::append(), Halide::Runtime::Internal::StringTable::prepend(), and Halide::Runtime::Internal::StringTable::resize().

## ◆ destroy() [1/2]

void Halide::Runtime::Internal::StringStorage::destroy | ( | void * | user_context,
|  | StringStorage * | string_storage
| ) |  |
| static

Definition at line 149 of file string_storage.h.

References Halide::cast(), current_allocator(), destroy(), halide_abort_if_false, and user_context.

Referenced by Halide::Runtime::Internal::StringTable::clear(), Halide::Runtime::Internal::StringTable::destroy(), destroy(), and ~StringStorage().

## ◆ initialize()

void Halide::Runtime::Internal::StringStorage::initialize | ( | void * | user_context,
|  | uint32_t | capacity = `0`,
|  | const SystemMemoryAllocatorFns & | sma = `default_allocator()`
| ) |  |

Definition at line 280 of file string_storage.h.

References Halide::cast(), Halide::Runtime::Internal::BlockStorage::initialize(), reserve(), terminate(), and user_context.

Referenced by create().

## ◆ destroy() [2/2]

void Halide::Runtime::Internal::StringStorage::destroy | ( | void * | user_context | ) |

Definition at line 286 of file string_storage.h.

References Halide::Runtime::Internal::BlockStorage::destroy(), and user_context.

## ◆ operator=()

StringStorage & Halide::Runtime::Internal::StringStorage::operator= | ( | const StringStorage & | other | ) |

Definition at line 157 of file string_storage.h.

References assign(), and Halide::cast().

## ◆ operator==()

bool Halide::Runtime::Internal::StringStorage::operator== | ( | const StringStorage & | other | ) | const

Definition at line 184 of file string_storage.h.

References Halide::cast(), Halide::Runtime::Internal::BlockStorage::data(), Halide::Runtime::Internal::BlockStorage::size(), and strncmp().

## ◆ operator!=()

bool Halide::Runtime::Internal::StringStorage::operator!= | ( | const StringStorage & | other | ) | const

Definition at line 193 of file string_storage.h.

References Halide::cast().

## ◆ contains() [1/2]

bool Halide::Runtime::Internal::StringStorage::contains | ( | const char * | str | ) | const

Definition at line 164 of file string_storage.h.

References Halide::cast(), Halide::Runtime::Internal::StringUtils::contains(), Halide::Runtime::Internal::BlockStorage::data(), Halide::Runtime::Internal::BlockStorage::empty(), and Halide::Runtime::Internal::BlockStorage::size().

## ◆ contains() [2/2]

bool Halide::Runtime::Internal::StringStorage::contains | ( | const StringStorage & | other | ) | const

Definition at line 172 of file string_storage.h.

References Halide::cast(), Halide::Runtime::Internal::StringUtils::contains(), Halide::Runtime::Internal::BlockStorage::data(), Halide::Runtime::Internal::BlockStorage::empty(), and Halide::Runtime::Internal::BlockStorage::size().

## ◆ reserve()

void Halide::Runtime::Internal::StringStorage::reserve | ( | void * | user_context,
|  | size_t | length
| ) |  |

Definition at line 197 of file string_storage.h.

References length(), Halide::Runtime::Internal::BlockStorage::reserve(), Halide::Runtime::Internal::BlockStorage::resize(), terminate(), and user_context.

Referenced by append(), append(), assign(), assign(), initialize(), prepend(), and prepend().

## ◆ assign() [1/2]

void Halide::Runtime::Internal::StringStorage::assign | ( | void * | user_context,
|  | char | ch
| ) |  |

Definition at line 203 of file string_storage.h.

References Halide::cast(), reserve(), terminate(), and user_context.

Referenced by operator=().

## ◆ assign() [2/2]

void Halide::Runtime::Internal::StringStorage::assign | ( | void * | user_context,
|  | const char * | str,
|  | size_t | length = `0`
| ) |  |

Definition at line 210 of file string_storage.h.

References Halide::Runtime::Internal::StringUtils::is_empty(), length(), Halide::Runtime::Internal::BlockStorage::replace(), reserve(), Halide::Runtime::Internal::strlen(), terminate(), and user_context.

## ◆ append() [1/2]

void Halide::Runtime::Internal::StringStorage::append | ( | void * | user_context,
|  | char | ch
| ) |  |

Definition at line 236 of file string_storage.h.

References Halide::cast(), Halide::Runtime::Internal::StringUtils::count_length(), data(), Halide::Runtime::Internal::BlockStorage::insert(), reserve(), Halide::Runtime::Internal::BlockStorage::size(), terminate(), and user_context.

## ◆ append() [2/2]

void Halide::Runtime::Internal::StringStorage::append | ( | void * | user_context,
|  | const char * | str,
|  | size_t | length = `0`
| ) |  |

Definition at line 222 of file string_storage.h.

References Halide::cast(), Halide::Runtime::Internal::StringUtils::count_length(), data(), Halide::Runtime::Internal::BlockStorage::insert(), Halide::Runtime::Internal::StringUtils::is_empty(), length(), reserve(), Halide::Runtime::Internal::BlockStorage::size(), Halide::Runtime::Internal::strlen(), terminate(), and user_context.

## ◆ prepend() [1/2]

void Halide::Runtime::Internal::StringStorage::prepend | ( | void * | user_context,
|  | char | ch
| ) |  |

Definition at line 258 of file string_storage.h.

References Halide::cast(), Halide::Runtime::Internal::StringUtils::count_length(), data(), Halide::Runtime::Internal::BlockStorage::prepend(), reserve(), Halide::Runtime::Internal::BlockStorage::size(), terminate(), and user_context.

## ◆ prepend() [2/2]

void Halide::Runtime::Internal::StringStorage::prepend | ( | void * | user_context,
|  | const char * | str,
|  | size_t | length = `0`
| ) |  |

Definition at line 244 of file string_storage.h.

References Halide::cast(), Halide::Runtime::Internal::StringUtils::count_length(), data(), Halide::Runtime::Internal::BlockStorage::insert(), Halide::Runtime::Internal::StringUtils::is_empty(), length(), reserve(), Halide::Runtime::Internal::BlockStorage::size(), Halide::Runtime::Internal::strlen(), terminate(), and user_context.

## ◆ clear()

void Halide::Runtime::Internal::StringStorage::clear | ( | void * | user_context | ) |

Definition at line 275 of file string_storage.h.

References Halide::Runtime::Internal::BlockStorage::clear(), terminate(), and user_context.

## ◆ terminate()

void Halide::Runtime::Internal::StringStorage::terminate | ( | void * | user_context,
|  | size_t | length
| ) |  |

Definition at line 266 of file string_storage.h.

References Halide::cast(), halide_error(), Halide::Runtime::Internal::BlockStorage::is_valid(), length(), and user_context.

Referenced by append(), append(), assign(), assign(), clear(), initialize(), prepend(), prepend(), and reserve().

## ◆ length()

size_t Halide::Runtime::Internal::StringStorage::length | ( |  | ) | const

Definition at line 290 of file string_storage.h.

References Halide::Runtime::Internal::StringUtils::count_length(), data(), and Halide::Runtime::Internal::BlockStorage::size().

Referenced by append(), assign(), prepend(), reserve(), and terminate().

## ◆ data()

const char * Halide::Runtime::Internal::StringStorage::data | ( |  | ) | const

Definition at line 294 of file string_storage.h.

References Halide::Runtime::Internal::BlockStorage::data().

Referenced by append(), append(), length(), prepend(), and prepend().

## ◆ current_allocator()

const SystemMemoryAllocatorFns & Halide::Runtime::Internal::StringStorage::current_allocator | ( |  | ) | const

Definition at line 299 of file string_storage.h.

References Halide::Runtime::Internal::BlockStorage::current_allocator().

Referenced by destroy().

## ◆ default_allocator()

const SystemMemoryAllocatorFns & Halide::Runtime::Internal::StringStorage::default_allocator | ( |  | ) |
| static

Definition at line 304 of file string_storage.h.

References Halide::Runtime::Internal::BlockStorage::default_allocator().

The documentation for this class was generated from the following file:

- src/runtime/internal/string_storage.h