HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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, int overwrite=0, 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 (UT_ValArray< OP_NetworkBox * > &&src) SYS_NOEXCEPT
 
 UT_ValArray (const UT_Array< OP_NetworkBox * > &src)
 
 UT_ValArray (exint capacity=0)
 
 UT_ValArray (exint capacity, exint entries)
 
UT_ValArrayoperator= (const UT_ValArray< OP_NetworkBox * > &src)
 
UT_ValArrayoperator= (const UT_Array< OP_NetworkBox * > &src)
 
UT_ValArrayoperator= (UT_ValArray< OP_NetworkBox * > &&src)
 
UT_ValArrayoperator= (UT_Array< OP_NetworkBox * > &&src)
 
exint sortAndRemoveDuplicates ()
 
void sort (Comparator compare)
 
void sort ()
 
void stdsort (ComparatorBool is_less)
 
void sortAscending ()
 
void stableSort (ComparatorBool is_less)
 
void stableSort ()
 
OP_NetworkBoxselectNthLargest (int idx, ComparatorBool is_less)
 
OP_NetworkBoxselectNthLargest (int idx)
 
exint uniqueSortedFind (const OP_NetworkBox *&item, Comparator compare) const
 
exint uniqueSortedFind (const OP_NetworkBox *&item, ComparatorBool is_less) const
 
exint uniqueSortedFind (const OP_NetworkBox *&item) const
 
exint uniqueSortedFindAscending (const OP_NetworkBox *&item) const
 
exint sortedInsert (const OP_NetworkBox *&t, Comparator compare)
 
exint sortedInsert (const OP_NetworkBox *&t, ComparatorBool is_less)
 
exint sortedInsert (const OP_NetworkBox *&t)
 
exint uniqueSortedInsert (const OP_NetworkBox *&t, Comparator compare)
 
exint uniqueSortedInsert (const OP_NetworkBox *&t, ComparatorBool is_less)
 
exint uniqueSortedInsert (const OP_NetworkBox *&t)
 
exint uniqueSortedInsertAscending (const OP_NetworkBox *&t)
 
void merge (const UT_Array< OP_NetworkBox * > &other, int direction, bool allow_dups, ComparatorBool is_less)
 
void merge (const UT_ValArray< OP_NetworkBox * > &other, int direction, bool allow_dups)
 
bool hasSortedSubset (const UT_ValArray< OP_NetworkBox * > &other, Comparator compare=compareElements) const
 
void sortedUnion (const UT_ValArray< OP_NetworkBox * > &other, Comparator compare=compareElements)
 
void sortedUnion (const UT_ValArray< OP_NetworkBox * > &other, UT_ValArray< OP_NetworkBox * > &result, Comparator compare=compareElements) const
 
void sortedIntersection (const UT_ValArray< OP_NetworkBox * > &other, Comparator compare=compareElements)
 
void sortedIntersection (const UT_ValArray< OP_NetworkBox * > &other, UT_ValArray< OP_NetworkBox * > &result, Comparator compare=compareElements) const
 
void sortedSetDifference (const UT_ValArray< OP_NetworkBox * > &other, Comparator compare=compareElements)
 
void sortedSetDifference (const UT_ValArray< OP_NetworkBox * > &other, UT_ValArray< OP_NetworkBox * > &result, Comparator compare=compareElements) const
 
exint heapPush (const OP_NetworkBox *&t, Comparator compare)
 
OP_NetworkBoxheapPop (Comparator compare)
 
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) SYS_NOEXCEPT
 Move constructor. Steals the working data from the original. More...
 
 UT_Array (exint capacity, exint size)
 Construct based on given capacity and size. More...
 
 UT_Array (exint capacity=0)
 Construct based on given capacity with a size of 0. More...
 
 UT_Array (std::initializer_list< OP_NetworkBox * > init)
 Construct with the contents of an initializer list. More...
 
 ~UT_Array ()
 
void swap (UT_Array< OP_NetworkBox * > &other)
 
exint append (void)
 
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 uniqueSortedFind (const OP_NetworkBox *&item, Comparator compare) const
 
exint uniqueSortedFind (const OP_NetworkBox *&item, ComparatorBool is_less) 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, Comparator compare) 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, 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, Comparator compare)
 
void sortedSetDifference (const UT_Array< OP_NetworkBox * > &other, UT_Array< OP_NetworkBox * > &result, Comparator compare) const
 
void fromStdVector (const std::vector< OP_NetworkBox * > &vec)
 Convert from an std::vector. More...
 
void toStdVector (std::vector< OP_NetworkBox * > &vec) const
 Convert to an std::vector. More...
 
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 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 OP_NetworkBox *&t)
 
exint removeIndex (exint index)
 
void removeLast ()
 
void removeRange (exint begin_i, exint end_i)
 Remove the range [begin_i,end_i) of elements from the array. More...
 
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 srcIdx, exint destIdx, exint howMany)
 
void cycle (exint howMany)
 Cyclically shifts the entire array by howMany. 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 OP_NetworkBox *&t, exint s=0) const
 
exint find (const OP_NetworkBox *&t, Comparator compare) const
 
void reverse ()
 Reverses the array by swapping elements in mirrored locations. More...
 
exint index (const OP_NetworkBox *&t) const
 
exint safeIndex (const OP_NetworkBox *&t) const
 
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 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)
 
OP_NetworkBoxselectNthLargest (exint idx, ComparatorBool is_less)
 
void setCapacity (exint newcapacity)
 
void setCapacityIfNeeded (exint mincapacity)
 
void bumpCapacity (exint mincapacity)
 
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 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(*applyFct)(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...
 
bool isHeapBuffer (OP_NetworkBox **data) const
 
exint sortedInsert (const OP_NetworkBox *&t, Comparator compare)
 
exint sortedInsert (const OP_NetworkBox *&t, ComparatorBool is_less)
 

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 * >
exint appendImpl (S &&s)
 
exint insertImpl (S &&s, exint index)
 Similar to appendImpl() but for insertion. More...
 
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)
 
static void copyConstructRange (OP_NetworkBox **dst, const OP_NetworkBox **src, exint n)
 
static void trivialConstruct (OP_NetworkBox *&dst)
 Element Constructor. More...
 
static void trivialConstructRange (OP_NetworkBox **dst, exint n)
 
static void trivialDestruct (OP_NetworkBox *&dst)
 Element Destructor. More...
 
static void trivialDestructRange (OP_NetworkBox **dst, exint n)
 

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,
int  overwrite = 0,
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: