HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_NetworkBoxList Class Reference

#include <OP_NetworkBoxList.h>

+ Inheritance diagram for OP_NetworkBoxList:

Public Member Functions

 OP_NetworkBoxList (OP_Network *net)
 
 ~OP_NetworkBoxList ()
 
void clearAndDestroy ()
 Remove all network boxes from this list. More...
 
OP_NetworkBoxcreateNetworkBox (const char *name, OP_NetworkBoxItemList *items=nullptr)
 
OP_NetworkBoxfindNetworkBox (const char *name) const
 Find and return a given network box by name, or NULL if it's not found. More...
 
int findNetworkBoxIndex (const char *name) const
 Find the index of a given network box by name. Returns -1 if not found. More...
 
int findNetworkBoxIndex (OP_NetworkBox *netbox) const
 Find the index of a given network box by ptr. Returns -1 if not found. More...
 
bool deleteNetworkBox (OP_NetworkBox *netbox)
 
bool deleteNetworkBox (int index)
 
OP_ERROR save (std::ostream &os, const OP_SaveFlags &flags, const char *path_prefix) const
 
bool load (UT_IStream &is, const char *path, bool path_contains_network, bool path_contains_packet_ext, OP_OverwriteAction overwrite=OP_NO_OVERWRITE, OP_NetworkBox **created=NULL)
 
int saveListToClipboard (std::ostream &os, const OP_SaveFlags &flags, const UT_ValArray< OP_NetworkBox * > &netboxes) const
 
OP_ERROR saveSingleNetworkBox (std::ostream &os, OP_NetworkBox &netbox, const OP_SaveFlags &flags, const char *path_prefix) const
 
int64 getMemoryUsage (bool inclusive) const
 Return the amount of memory owned by this OP_NetworkBoxList. More...
 
- Public Member Functions inherited from UT_ValArray< OP_NetworkBox * >
 UT_ValArray (const UT_ValArray< OP_NetworkBox * > &src)
 
 UT_ValArray (const UT_Array< OP_NetworkBox * > &src)
 
 UT_ValArray (UT_ValArray< OP_NetworkBox * > &&src) noexcept
 
 UT_ValArray (UT_Array< OP_NetworkBox * > &&src) noexcept
 
 UT_ValArray (exint capacity=0)
 
 UT_ValArray (exint capacity, exint entries)
 
 UT_ValArray (std::initializer_list< OP_NetworkBox * > init)
 
UT_ValArrayoperator= (const UT_ValArray< OP_NetworkBox * > &src)
 
UT_ValArrayoperator= (const UT_Array< OP_NetworkBox * > &src)
 
UT_ValArrayoperator= (std::initializer_list< OP_NetworkBox * > src)
 
UT_ValArrayoperator= (UT_ValArray< OP_NetworkBox * > &&src)
 
UT_ValArrayoperator= (UT_Array< OP_NetworkBox * > &&src)
 
void sortAscending ()
 
exint uniqueSortedFindAscending (const OP_NetworkBox *&item) const
 
exint uniqueSortedInsertAscending (const OP_NetworkBox *&t)
 
bool hasSortedSubset (const UT_ValArray< OP_NetworkBox * > &other) const
 
bool hasSortedSubset (const UT_ValArray< OP_NetworkBox * > &other, Comparator compare) const
 
bool hasSortedSubset (const UT_Array< OP_NetworkBox * > &other, ComparatorBool is_less) const
 
void sortedUnion (const UT_ValArray< OP_NetworkBox * > &other)
 
void sortedUnion (const UT_ValArray< OP_NetworkBox * > &other, Comparator compare)
 
void sortedUnion (const UT_ValArray< OP_NetworkBox * > &other, ComparatorBool is_less)
 
void sortedUnion (const UT_ValArray< OP_NetworkBox * > &other, UT_ValArray< OP_NetworkBox * > &result) const
 
void sortedUnion (const UT_ValArray< OP_NetworkBox * > &other, UT_ValArray< OP_NetworkBox * > &result, Comparator compare) const
 
void sortedUnion (const UT_ValArray< OP_NetworkBox * > &other, UT_ValArray< OP_NetworkBox * > &result, ComparatorBool is_less) const
 
void sortedIntersection (const UT_ValArray< OP_NetworkBox * > &other)
 
void sortedIntersection (const UT_ValArray< OP_NetworkBox * > &other, Comparator compare)
 
void sortedIntersection (const UT_ValArray< OP_NetworkBox * > &other, ComparatorBool is_less)
 
void sortedIntersection (const UT_ValArray< OP_NetworkBox * > &other, UT_ValArray< OP_NetworkBox * > &result) const
 
void sortedIntersection (const UT_ValArray< OP_NetworkBox * > &other, UT_ValArray< OP_NetworkBox * > &result, Comparator compare) const
 
void sortedIntersection (const UT_ValArray< OP_NetworkBox * > &other, UT_ValArray< OP_NetworkBox * > &result, ComparatorBool is_less) const
 
void sortedSetDifference (const UT_ValArray< OP_NetworkBox * > &other)
 
void sortedSetDifference (const UT_ValArray< OP_NetworkBox * > &other, Comparator compare)
 
void sortedSetDifference (const UT_ValArray< OP_NetworkBox * > &other, ComparatorBool is_less)
 
void sortedSetDifference (const UT_ValArray< OP_NetworkBox * > &other, UT_ValArray< OP_NetworkBox * > &result) const
 
void sortedSetDifference (const UT_ValArray< OP_NetworkBox * > &other, UT_ValArray< OP_NetworkBox * > &result, Comparator compare) const
 
void sortedSetDifference (const UT_ValArray< OP_NetworkBox * > &other, UT_ValArray< OP_NetworkBox * > &result, ComparatorBool is_less) const
 
int removeZeros ()
 
void collapse ()
 
OP_NetworkBoxsum () const
 Functions which are only specialized for int{32,64}, fpreal{32,64}. More...
 
void display () const
 Prints the constents of the array. More...
 
- Public Member Functions inherited from UT_Array< OP_NetworkBox * >
 UT_Array (const UT_Array< OP_NetworkBox * > &a)
 
 UT_Array (UT_Array< OP_NetworkBox * > &&a) noexcept
 Move constructor. Steals the working data from the original. More...
 
 UT_Array (const exint capacity, const exint size)
 Construct based on given capacity and size. More...
 
 UT_Array (const exint capacity=0)
 Construct based on given capacity with a size of 0. More...
 
 UT_Array (std::initializer_list< OP_NetworkBox * > init)
 
 ~UT_Array ()
 
void swap (UT_Array< OP_NetworkBox * > &other)
 
exint append ()
 
exint append (const OP_NetworkBox *&t)
 
exint append (OP_NetworkBox *&&t)
 
exint append (const OP_NetworkBox *&t, bool check_dup)
 
void append (const OP_NetworkBox **pt, exint count)
 
void appendMultiple (const OP_NetworkBox *&t, exint count)
 
exint insert (exint index)
 
exint insert (const OP_NetworkBox *&t, exint i)
 
exint insert (OP_NetworkBox *&&t, exint i)
 
exint emplace_back (S &&...s)
 
exint uniqueSortedInsert (const OP_NetworkBox *&t, Comparator compare)
 
exint uniqueSortedInsert (const OP_NetworkBox *&t, ComparatorBool is_less={})
 
exint uniqueSortedInsert (OP_NetworkBox *&&t, Comparator compare)
 
exint uniqueSortedFind (const OP_NetworkBox *&item, ComparatorBool is_less={}) const
 
exint uniqueSortedFind (const OP_NetworkBox *&item, Comparator compare) const
 
void merge (const UT_Array< OP_NetworkBox * > &other, int direction, bool allow_dups, ComparatorBool is_less={})
 
bool hasSortedSubset (const UT_Array< OP_NetworkBox * > &other, ComparatorBool is_less={}) const
 
bool hasSortedSubset (const UT_Array< OP_NetworkBox * > &other, Comparator compare) const
 
void sortedUnion (const UT_Array< OP_NetworkBox * > &other, ComparatorBool is_less={})
 
void sortedUnion (const UT_Array< OP_NetworkBox * > &other, UT_Array< OP_NetworkBox * > &result, ComparatorBool is_less={}) const
 
void sortedUnion (const UT_Array< OP_NetworkBox * > &other, Comparator compare)
 
void sortedUnion (const UT_Array< OP_NetworkBox * > &other, UT_Array< OP_NetworkBox * > &result, Comparator compare) const
 
void sortedIntersection (const UT_Array< OP_NetworkBox * > &other, ComparatorBool is_less={})
 
void sortedIntersection (const UT_Array< OP_NetworkBox * > &other, UT_Array< OP_NetworkBox * > &result, ComparatorBool is_less={}) const
 
void sortedIntersection (const UT_Array< OP_NetworkBox * > &other, Comparator compare)
 
void sortedIntersection (const UT_Array< OP_NetworkBox * > &other, UT_Array< OP_NetworkBox * > &result, Comparator compare) const
 
void sortedSetDifference (const UT_Array< OP_NetworkBox * > &other, ComparatorBool is_less={})
 
void sortedSetDifference (const UT_Array< OP_NetworkBox * > &other, UT_Array< OP_NetworkBox * > &result, ComparatorBool is_less={}) const
 
void sortedSetDifference (const UT_Array< OP_NetworkBox * > &other, Comparator compare)
 
void sortedSetDifference (const UT_Array< OP_NetworkBox * > &other, UT_Array< OP_NetworkBox * > &result, Comparator compare) const
 
exint heapPush (const OP_NetworkBox *&t, Comparator compare)
 
OP_NetworkBoxheapPop (Comparator compare)
 
const OP_NetworkBox *& heapMax () const
 
exint concat (const UT_Array< OP_NetworkBox * > &a)
 Takes another T array and concatenate it onto my end. More...
 
exint concat (UT_Array< OP_NetworkBox * > &&a) noexcept
 Takes another T array and concatenate it onto my end. More...
 
exint multipleInsert (exint index, exint count)
 Insert an element "count" times at the given index. Return the index. More...
 
exint insertAt (const OP_NetworkBox *&t, exint index)
 
bool isValidIndex (exint index) const
 Return true if given index is valid. More...
 
exint findAndRemove (const S &s)
 
exint removeIndex (exint index)
 
SYS_FORCE_INLINE void removeLast ()
 
void removeRange (exint begin_i, exint end_i)
 
void extractRange (exint begin_i, exint end_i, UT_Array< OP_NetworkBox * > &dest)
 
exint removeIf (IsEqual is_equal)
 
void collapseIf (IsEqual is_equal)
 Remove all matching elements. Also sets the capacity of the array. More...
 
void move (exint src_idx, exint dst_idx, exint how_many)
 
void cycle (exint how_many)
 Cyclically shifts the entire array by how_many. More...
 
void constant (const OP_NetworkBox *&v)
 Quickly set the array to a single value. More...
 
void zero ()
 Zeros the array if a POD type, else trivial constructs if a class type. More...
 
exint find (const S &s, exint start=0) const
 
exint sortedFind (const OP_NetworkBox *&t, Comparator compare) const
 
void reverse ()
 Reverses the array by swapping elements in mirrored locations. More...
 
void sort (ComparatorBool is_less={})
 Sort using std::sort with bool comparator. Defaults to operator<(). More...
 
void sort (Comparator compare)
 
void stdsort (ComparatorBool is_less)
 Sort using std::sort. The ComparatorBool uses the less-than semantics. More...
 
void stableSort (ComparatorBool is_less={})
 
void stableSortRange (ComparatorBool is_less, exint start, exint end)
 Like stableSort, but operates on a subset of the array. More...
 
void stableSortIndices (UT_Array< I > &indices, ComparatorBool is_less) const
 
void stableArgSort (UT_Array< I > &indices, ComparatorBool is_less) const
 
void stableSortByKey (const UT_Array< K > &keys, ComparatorBool is_less)
 
exint sortedRemoveDuplicates ()
 
exint sortedRemoveDuplicatesIf (CompareEqual compare_equal)
 
exint sortAndRemoveDuplicates (ComparatorBool is_less={})
 
OP_NetworkBoxselectNthLargest (exint idx, ComparatorBool is_less={})
 
void setCapacity (exint new_capacity)
 
void setCapacityIfNeeded (exint min_capacity)
 
void bumpCapacity (exint min_capacity)
 
void bumpSize (exint newsize)
 
void bumpEntries (exint newsize)
 
exint capacity () const
 
exint size () const
 
exint entries () const
 Alias of size(). size() is preferred. More...
 
void entries (exint newsize)
 Alias of setSize(). setSize() is preferred. More...
 
bool isEmpty () const
 Returns true iff there are no occupied elements in the array. More...
 
int64 getMemoryUsage (bool inclusive=false) const
 
void setSize (exint newsize)
 
void setSizeIfNeeded (exint minsize)
 
void setSizeNoInit (exint newsize)
 
void truncate (exint maxsize)
 Decreases, but never expands, to the given maxsize. More...
 
void clear ()
 Resets list to an empty list. More...
 
UT_Array< OP_NetworkBox * > & operator= (const UT_Array< OP_NetworkBox * > &a)
 
UT_Array< OP_NetworkBox * > & operator= (std::initializer_list< OP_NetworkBox * > ilist)
 Replace the contents with those from the initializer_list ilist. More...
 
UT_Array< OP_NetworkBox * > & operator= (UT_Array< OP_NetworkBox * > &&a)
 Move the contents of array a to this array. More...
 
bool operator== (const UT_Array< OP_NetworkBox * > &a) const
 
bool operator!= (const UT_Array< OP_NetworkBox * > &a) const
 
int isEqual (const UT_Array< OP_NetworkBox * > &a, Comparator compare) const
 
OP_NetworkBox *& operator() (exint i)
 
const OP_NetworkBox *& operator() (exint i) const
 
OP_NetworkBox *& operator[] (exint i)
 
const OP_NetworkBox *& operator[] (exint i) const
 
OP_NetworkBox *& forcedRef (exint i)
 
OP_NetworkBoxforcedGet (exint i) const
 
OP_NetworkBox *& last ()
 
const OP_NetworkBox *& last () const
 
exint apply (int(*apply_func)(OP_NetworkBox *&t, void *d), void *d)
 
OP_NetworkBoxaccumulate (const OP_NetworkBox *&init_value, BinaryOp add) const
 
OP_NetworkBox ** getArray () const
 
const OP_NetworkBox ** getRawArray () const
 
OP_NetworkBox ** array ()
 
const OP_NetworkBox ** array () const
 
OP_NetworkBox ** data ()
 
const OP_NetworkBox ** data () const
 
OP_NetworkBox ** aliasArray (OP_NetworkBox **newdata)
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 End iterator. More...
 
const_iterator end () const
 End const iterator. Consider using it.atEnd() instead. More...
 
reverse_iterator rbegin ()
 Begin iterating over the array in reverse. More...
 
const_reverse_iterator rbegin () const
 Begin iterating over the array in reverse. More...
 
reverse_iterator rend ()
 End reverse iterator. More...
 
const_reverse_iterator rend () const
 End reverse iterator. Consider using it.atEnd() instead. More...
 
UT_IteratorRange< iteratorrange ()
 
UT_IteratorRange< const_iteratorrange () const
 
UT_IteratorRange
< reverse_iterator
rrange ()
 
UT_IteratorRange
< const_reverse_iterator
rrange () const
 
void removeItem (const reverse_iterator &it)
 Remove item specified by the reverse_iterator. More...
 
void unsafeShareData (UT_Array< OP_NetworkBox * > &src)
 
void unsafeShareData (OP_NetworkBox **src, exint srcsize)
 
void unsafeShareData (OP_NetworkBox **src, exint size, exint capacity)
 
void unsafeClearData ()
 
bool isHeapBuffer () const
 Returns true if the data used by the array was allocated on the heap. More...
 
exint sortedInsert (const OP_NetworkBox *&t, Comparator compare)
 
exint sortedInsert (const OP_NetworkBox *&t, ComparatorBool is_less={})
 
exint index (const OP_NetworkBox *&t) const
 
exint safeIndex (const OP_NetworkBox *&t) const
 

Additional Inherited Members

- Public Types inherited from UT_ValArray< OP_NetworkBox * >
typedef int(* Comparator )(const OP_NetworkBox **, const OP_NetworkBox **)
 
- Public Types inherited from UT_Array< OP_NetworkBox * >
typedef OP_NetworkBoxvalue_type
 
typedef int(* Comparator )(const OP_NetworkBox **, const OP_NetworkBox **)
 
typedef base_iterator
< OP_NetworkBox *, true > 
iterator
 
typedef base_iterator< const
OP_NetworkBox *, true > 
const_iterator
 
typedef base_iterator
< OP_NetworkBox *, false > 
reverse_iterator
 
typedef base_iterator< const
OP_NetworkBox *, false > 
const_reverse_iterator
 
typedef const_iterator traverser
 
- Static Public Member Functions inherited from UT_ValArray< OP_NetworkBox * >
static bool compareElementsBool (const OP_NetworkBox *&a, const OP_NetworkBox *&b)
 
static int compareElements (const OP_NetworkBox **a, const OP_NetworkBox **b)
 
static bool isElementZero (const OP_NetworkBox *&a)
 
- Protected Member Functions inherited from UT_Array< OP_NetworkBox * >
 UT_Array (const UT_ArrayCT::ExternalCapacity, OP_NetworkBox **external_data, const exint external_capacity)
 
 UT_Array (const UT_ArrayCT::ExternalMove, OP_NetworkBox **external_data, const exint external_capacity, UT_Array &&a)
 
exint appendImpl (S &&s)
 
exint insertImpl (S &&s, exint index)
 Similar to appendImpl() but for insertion. More...
 
exint uniqueSortedInsertImpl (S &&s, Comparator compare)
 
void validateEmplaceArgs (First &&first, Rest &&...rest) const
 
void validateEmplaceArgs () const
 Base case for validateEmplaceArgs(). More...
 
- Static Protected Member Functions inherited from UT_Array< OP_NetworkBox * >
static constexpr
SYS_FORCE_INLINE bool 
isPOD ()
 
static void construct (OP_NetworkBox *&dst, S &&...s)
 
static void copyConstruct (OP_NetworkBox *&dst, const OP_NetworkBox *&src)
 

Detailed Description

Definition at line 27 of file OP_NetworkBoxList.h.

Constructor & Destructor Documentation

OP_NetworkBoxList::OP_NetworkBoxList ( OP_Network net)
OP_NetworkBoxList::~OP_NetworkBoxList ( )

Member Function Documentation

void OP_NetworkBoxList::clearAndDestroy ( )

Remove all network boxes from this list.

OP_NetworkBox* OP_NetworkBoxList::createNetworkBox ( const char *  name,
OP_NetworkBoxItemList items = nullptr 
)

Create a network box with the specified name and insert it into this OP_NetworkBoxList at the next available index. Returns a pointer to the OP_NetworkBox created or NULL if creation was unsuccessful. Pass in NULL as the name if you'd like a default name. If a duplicate name is passed in, it will be altered to make it unique. Passing in 'items' will automatically create a network box containing those items with the netbox positioned properly around them.

bool OP_NetworkBoxList::deleteNetworkBox ( OP_NetworkBox netbox)

Remove a network box by ptr. Returns true if it was successfully removed; false if the box wasn't found

bool OP_NetworkBoxList::deleteNetworkBox ( int  index)

Remove a network box by index. Returns true if it was successfully removed; false if the index is invalid

OP_NetworkBox* OP_NetworkBoxList::findNetworkBox ( const char *  name) const

Find and return a given network box by name, or NULL if it's not found.

int OP_NetworkBoxList::findNetworkBoxIndex ( const char *  name) const

Find the index of a given network box by name. Returns -1 if not found.

int OP_NetworkBoxList::findNetworkBoxIndex ( OP_NetworkBox netbox) const

Find the index of a given network box by ptr. Returns -1 if not found.

int64 OP_NetworkBoxList::getMemoryUsage ( bool  inclusive) const

Return the amount of memory owned by this OP_NetworkBoxList.

bool OP_NetworkBoxList::load ( UT_IStream is,
const char *  path,
bool  path_contains_network,
bool  path_contains_packet_ext,
OP_OverwriteAction  overwrite = OP_NO_OVERWRITE,
OP_NetworkBox **  created = NULL 
)

Load a network box from 'is'. Can load from both .hip files and the clipboard. 'path' is used as the new netbox's name (only the portion of path after the last slash). If 'overwrite' is specified, the new netbox will overwrite any other netboxes in this network with the same name, rather than modify its name to be unique. 'created' is used to return a ptr to the new network box.

OP_ERROR OP_NetworkBoxList::save ( std::ostream &  os,
const OP_SaveFlags flags,
const char *  path_prefix 
) const

Save the entire list to the ostream os. 'path_prefix' should be the path you want to save the netboxes as being under.

int OP_NetworkBoxList::saveListToClipboard ( std::ostream &  os,
const OP_SaveFlags flags,
const UT_ValArray< OP_NetworkBox * > &  netboxes 
) const

Saves all netboxes in the provided list to the clipboard. Returns the total # of items saved.

OP_ERROR OP_NetworkBoxList::saveSingleNetworkBox ( std::ostream &  os,
OP_NetworkBox netbox,
const OP_SaveFlags flags,
const char *  path_prefix 
) const

Save 'netbox' to 'os'. 'path_prefix' should be the path you want to save the netbox as being under.


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