20 #include "SheafSystem/subposet_names_record.h" 22 #include "SheafSystem/assert_contract.h" 23 #include "SheafSystem/std_sstream.h" 47 ensure(is_same_type(result));
68 result = result && attributes_record::invariant();
74 disable_invariant_check();
78 enable_invariant_check();
182 require(
scaffold().structure().state_is_read_write_accessible());
203 string ver_0_whole_name(
scaffold().structure().version_to_name(0));
246 while(lstream >> lsp_id)
256 getline(lstream, lsp_name,
'\t');
257 while(!lsp_name.empty())
260 getline(lstream, lsp_name,
'\t');
263 #ifdef DIAGNOSTIC_OUTPUT 264 cout <<
"lsp_id: " << lsp_id
265 <<
" names: " << lall_names
270 if(lall_names.
ct() == 0)
275 lspv[lsp_id] =
new subposet(&lposet);
284 lspv[lsp_id] =
new subposet(&lposet, lall_names[0]);
302 lspv[lsp_id] =
new subposet(&lposet);
307 lspv[lsp_id]->put_name(lall_names[0],
true,
false);
312 for(
int i=1; i<lall_names.
ct(); ++i)
314 if(!lspv[lsp_id]->has_name(lall_names[i]))
316 lspv[lsp_id]->put_name(lall_names[i],
false,
false);
349 require(
scaffold().structure().state_is_read_accessible());
353 stringstream lstream;
355 lstream <<
"Subposet names:" << endl;
364 for(
int i=0; i<lsp_ub; i++)
371 for(
int j=0; j<lall_names.
ct(); ++j)
373 lstream << lall_names[j] <<
'\t';
375 lstream <<
'\t' << endl;
void delete_subposet_name(const std::string &xname, bool xauto_access=false)
Make xname not a name for any subposet.
A client handle for a subposet.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
poset_scaffold & scaffold()
The scaffold for the poset associated with this record (mutable version).
size_type ct() const
The number of items currently in use.
virtual void transfer_poset_to_internal_buffer()
Initializes the internal buffer from the member with index xmbr_id.
A client handle for a general, abstract partially order set.
virtual bool includes_subposet(pod_index_type xsubposet_hub_id, bool xauto_access=true) const
True if this poset includes subposet with hub id xsubposet_hub_id.
A wrapper/adapter for the subposet names record. Intended for transferring subposet name data between...
std::vector< subposet * > & subposets()
Buffer for subposet handles (mutable version).
virtual bool invariant() const
Class invariant.
void attach_to_state(const poset_state_handle *xhost, pod_index_type xhub_id)
Attach this handle to the state with hub id xhub_id in the current version of host xhost...
virtual void all_names(block< std::string > &xresult, bool xauto_access=false) const
All the names for this.
Abstract base class with useful features for all objects.
subposet_names_record(poset_scaffold &xscaffold)
Creates an instance with type map xtype_map.
void push_back(const_reference_type item)
Insert item at the end of the items in the auto_block.
std::string _str_buf
The internal/external buffer.
void set_ct(size_type xct)
Sets ct() == xct.
bool is_internal() const
True if the internal buffer has been initialized.
void insert(pod_type xid, const scoped_index &xhub_id)
Make id xid in this id space equivalent to xhub_id in the hub id space. synonym for insert(xid...
virtual ~subposet_names_record()
Destructor.
void put_is_internal(bool xis_internal)
Sets is_internal to xis_internal.
SHEAF_DLL_SPEC void max(const vd &x0, vd_value_type &xresult, bool xauto_access)
Maximum component of x0, pre-allocated version.
poset_state_handle & structure()
The handle for the poset being transferred. (Name chosen to void name conflict with class poset...
subposet_index_space_type & subposet_id_space()
External to internal subposet index map for powerset() (mutable version).
A poset specific collection of data converters, various buffers and other data used while transferrin...
virtual subposet_names_record * clone() const
Virtual constructor; makes a new instance of the same type as this.
bool is_external() const
True if the external buffer has been initialized.
subposet & resident()
The resident subposet for structure() (mutable version).
An abstract wrapper/adapter for attributes records. Intended for transferring data between the kernel...
void initialize_subposet_id_space()
Initializes subposet_id_space().
An auto_block with a no-initialization initialization policy.
virtual void transfer_internal_buffer_to_poset()
Initializes member with index xmbr_id from the internal buffer.
void put_is_external(bool xis_external)
Sets is_external to xis_external.