LLVM 23.0.0git
llvm::cas::NamedValuesProxy Class Reference

A proxy for a loaded CAS Object in NamedValuesSchema. More...

#include "llvm/CAS/NamedValuesSchema.h"

Inheritance diagram for llvm::cas::NamedValuesProxy:
[legend]

Public Member Functions

const NamedValuesSchemagetSchema () const
 Get the schema associated with this proxy.
Error forEachEntry (function_ref< Error(const NamedValuesEntry &)> Callback) const
 Iterate over entries with a callback.
bool empty () const
 Check if the object is empty.
size_t size () const
 Get the number of entries in the CAS object.
std::optional< NamedValuesEntrylookup (StringRef Name) const
 Lookup an entry by name.
LLVM_ABI StringRef getName (size_t I) const
 Get the name of an entry by index.
NamedValuesEntry get (size_t I) const
 Get an entry by index.
Public Member Functions inherited from llvm::cas::ObjectProxy
ObjectStoregetCAS () const
CASID getID () const
ObjectRef getRef () const
size_t getNumReferences () const
ObjectRef getReference (size_t I) const
 operator CASID () const
CASID getReferenceID (size_t I) const
Error forEachReference (function_ref< Error(ObjectRef)> Callback) const
 Visit each reference in order, returning an error from Callback to stop early.
std::unique_ptr< MemoryBuffergetMemoryBuffer (StringRef Name="", bool RequiresNullTerminator=true) const
StringRef getData () const
 Get the content of the node. Valid as long as the CAS is valid.
Error exportDataToFile (StringRef Path) const
 Exports the data of an object to a file path.
 ObjectProxy ()=delete

Friends

class NamedValuesSchema

Additional Inherited Members

Static Public Member Functions inherited from llvm::cas::ObjectProxy
static ObjectProxy load (ObjectStore &CAS, ObjectRef Ref, ObjectHandle Node)

Detailed Description

A proxy for a loaded CAS Object in NamedValuesSchema.

Definition at line 120 of file NamedValuesSchema.h.

Member Function Documentation

◆ empty()

bool llvm::cas::NamedValuesProxy::empty ( ) const
inline

Check if the object is empty.

Definition at line 132 of file NamedValuesSchema.h.

References size().

◆ forEachEntry()

Error llvm::cas::NamedValuesProxy::forEachEntry ( function_ref< Error(const NamedValuesEntry &)> Callback) const
inline

Iterate over entries with a callback.

Definition at line 127 of file NamedValuesSchema.h.

◆ get()

NamedValuesEntry llvm::cas::NamedValuesProxy::get ( size_t I) const
inline

Get an entry by index.

Definition at line 148 of file NamedValuesSchema.h.

References I.

Referenced by lookup().

◆ getName()

StringRef NamedValuesProxy::getName ( size_t I) const

Get the name of an entry by index.

Definition at line 183 of file NamedValuesSchema.cpp.

References data, llvm::cas::ObjectProxy::getData(), I, and llvm::support::endian::read32le().

◆ getSchema()

const NamedValuesSchema & llvm::cas::NamedValuesProxy::getSchema ( ) const
inline

Get the schema associated with this proxy.

Definition at line 123 of file NamedValuesSchema.h.

References NamedValuesSchema.

◆ lookup()

std::optional< NamedValuesEntry > llvm::cas::NamedValuesProxy::lookup ( StringRef Name) const
inline

Lookup an entry by name.

Definition at line 138 of file NamedValuesSchema.h.

References get(), and I.

◆ size()

size_t llvm::cas::NamedValuesProxy::size ( ) const
inline

Get the number of entries in the CAS object.

Definition at line 135 of file NamedValuesSchema.h.

Referenced by empty().

◆ NamedValuesSchema

friend class NamedValuesSchema
friend

Definition at line 154 of file NamedValuesSchema.h.

References NamedValuesSchema.

Referenced by getSchema(), and NamedValuesSchema.


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