libbio
Loading...
Searching...
No Matches
Public Member Functions | List of all members
bio::Cow< T > Class Template Reference

#include <Cow.h>

Inheritance diagram for bio::Cow< T >:
Inheritance graph
[legend]
Collaboration diagram for bio::Cow< T >:
Collaboration graph
[legend]

Public Member Functions

 Cow (Pointer< chemical::Atom > source, chemical::AtomicNumber bondId, Pointer< physical::Wave > bondedSnapshot)
 
Pointer< TMoo ()
 
Pointer< const Toperator-> () const
 
 operator Pointer< const T > () const
 
 operator Pointer< T > ()
 
- Public Member Functions inherited from bio::chemical::AtomicCow
 AtomicCow (Pointer< Atom > source, AtomicNumber bondId, Pointer< physical::Wave > bondedSnapshot)
 
bool IsValid () const
 
- Public Member Functions inherited from bio::CowPtr< physical::Wave >
 CowPtr ()
 
 CowPtr (physical::Wave *owned, bool immutable=false)
 
 CowPtr (const CowPtr &other)
 
bool IsBorrowed () const
 
CowPtroperator= (const CowPtr &other)
 
 ~CowPtr ()
 
const physical::WaveView () const
 
bool IsShared () const
 
bool IsNull () const
 
physical::WaveMoo (CLONE cloneFn)
 
physical::WaveMutable ()
 
void Reset (physical::Wave *owned)
 

Additional Inherited Members

- Public Types inherited from bio::CowPtr< physical::Wave >
typedef physical::Wave Type
 
- Static Public Member Functions inherited from bio::CowPtr< physical::Wave >
static CowPtr Borrow (physical::Wave *borrowed)
 
- Protected Member Functions inherited from bio::chemical::AtomicCow
const physical::WaveReadBonded () const
 
Pointer< physical::WaveWriteBonded ()
 
- Protected Attributes inherited from bio::chemical::AtomicCow
Pointer< AtommSource
 
AtomicNumber mBondId
 

Detailed Description

template<typename T>
class bio::Cow< T >

Cow< T > — the typed bonded copy-on-write access handle (RFC_BONDED_COW_HANDLE §12), top of sceon's CowPtr -> AtomicCow -> Cow< T > hierarchy. A transient cursor over a bonded T that behaves as close to Pointer<T> as copy-on-write allows:

TODO (C++26): let bare cow->NonConstMethod() copy-on-write per-method instead of erroring. It cannot be done in C++<=20 — operator-> must commit to Pointer<const T> vs Pointer<T> BEFORE the method is named, so it can't see the callee's const-ness (the exec_around execute-around proxy makes this concrete: its bracket is method-agnostic). The clean fix is static reflection (P2996) + token injection (P3294): reflect T's member functions, read each one's const-qualification, and inject a forwarder per method into a generated CowProxy< T > (const -> View, non-const -> Moo). Gate under BIO_CPP_VERSION >= 26 ON TOP of this surface; callers don't change. (Do NOT reach for macro/codegen registries: a missed or mis-tagged annotation is a SILENT bleed, strictly worse than today's compile error.)

Template Parameters
Ta non-pointer, non-reference bonded Wave-implementation type.

Constructor & Destructor Documentation

◆ Cow()

template<typename T >
bio::Cow< T >::Cow ( Pointer< chemical::Atom source,
chemical::AtomicNumber  bondId,
Pointer< physical::Wave bondedSnapshot 
)
inline

Member Function Documentation

◆ Moo()

template<typename T >
Pointer< T > bio::Cow< T >::Moo ( )
inline

Moo() — Make Owned Object. The explicit write move: copy-on-write detach the bonded and return it as a mutable, uniquely-owned T (cow.Moo()->Mutate()). This is the named counterpart to the implicit, zero-ceremony reads (operator-> / const-pointer extraction) – the one verb you spell out, because writes should be deliberate. (The cow says Moo when you make it your own. A unique token on purpose: one regex un-does it if it ever stops sparking joy.)

Returns
the uniquely-owned T, or NULL.

◆ operator Pointer< const T >()

template<typename T >
bio::Cow< T >::operator Pointer< const T > ( ) const
inline

◆ operator Pointer< T >()

template<typename T >
bio::Cow< T >::operator Pointer< T > ( )
inline

◆ operator->()

template<typename T >
Pointer< const T > bio::Cow< T >::operator-> ( ) const
inline

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