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

#include <OP_PostItNoteList.h>

+ Inheritance diagram for OP_PostItNoteList:

Public Types

typedef UT_ValArray< OP_PostIt * > Base
 
- Public Types inherited from UT_ValArray< OP_PostIt * >
typedef int(* Comparator )(const OP_PostIt **, const OP_PostIt **)
 
- Public Types inherited from UT_Array< OP_PostIt * >
typedef OP_PostItvalue_type
 
typedef int(* Comparator )(const OP_PostIt **, const OP_PostIt **)
 
typedef base_iterator
< OP_PostIt *, true > 
iterator
 
typedef base_iterator< const
OP_PostIt *, true > 
const_iterator
 
typedef base_iterator
< OP_PostIt *, false > 
reverse_iterator
 
typedef base_iterator< const
OP_PostIt *, false > 
const_reverse_iterator
 
typedef const_iterator traverser
 

Public Member Functions

 OP_PostItNoteList (OP_Network *net)
 
 ~OP_PostItNoteList ()
 
void clearAndDestroy ()
 Remove all network boxes from this list. More...
 
OP_PostItcreatePostItNote (const char *name)
 
OP_PostItfindPostItNote (const char *name) const
 Find and return a given network box by name, or NULL if it's not found. More...
 
int findPostItNoteIndex (const char *name) const
 Find the index of a given network box by name. Returns -1 if not found. More...
 
int findPostItNoteIndex (OP_PostIt *netbox) const
 Find the index of a given network box by ptr. Returns -1 if not found. More...
 
bool deletePostItNote (OP_PostIt *netbox)
 
bool deletePostItNote (int index)
 
bool load (UT_IStream &is, const char *path, bool path_contains_network, bool path_contains_packet_ext, OP_OverwriteAction overwrite=OP_NO_OVERWRITE, OP_PostIt **created=NULL)
 
int64 getMemoryUsage (bool inclusive) const
 Return the amount of memory owned by this OP_PostItNoteList. More...
 
- Public Member Functions inherited from UT_ValArray< OP_PostIt * >
 UT_ValArray (const UT_ValArray< OP_PostIt * > &src)
 
 UT_ValArray (const UT_Array< OP_PostIt * > &src)
 
 UT_ValArray (UT_ValArray< OP_PostIt * > &&src) noexcept
 
 UT_ValArray (UT_Array< OP_PostIt * > &&src) noexcept
 
 UT_ValArray (exint capacity=0)
 
 UT_ValArray (exint capacity, exint entries)
 
 UT_ValArray (std::initializer_list< OP_PostIt * > init)
 
UT_ValArrayoperator= (const UT_ValArray< OP_PostIt * > &src)
 
UT_ValArrayoperator= (const UT_Array< OP_PostIt * > &src)
 
UT_ValArrayoperator= (std::initializer_list< OP_PostIt * > src)
 
UT_ValArrayoperator= (UT_ValArray< OP_PostIt * > &&src)
 
UT_ValArrayoperator= (UT_Array< OP_PostIt * > &&src)
 
void sortAscending ()
 
exint uniqueSortedFindAscending (const OP_PostIt *&item) const
 
exint uniqueSortedInsertAscending (const OP_PostIt *&t)
 
bool hasSortedSubset (const UT_ValArray< OP_PostIt * > &other) const
 
bool hasSortedSubset (const UT_ValArray< OP_PostIt * > &other, Comparator compare) const
 
bool hasSortedSubset (const UT_Array< OP_PostIt * > &other, ComparatorBool is_less) const
 
void sortedUnion (const UT_ValArray< OP_PostIt * > &other)
 
void sortedUnion (const UT_ValArray< OP_PostIt * > &other, Comparator compare)
 
void sortedUnion (const UT_ValArray< OP_PostIt * > &other, ComparatorBool is_less)
 
void sortedUnion (const UT_ValArray< OP_PostIt * > &other, UT_ValArray< OP_PostIt * > &result) const
 
void sortedUnion (const UT_ValArray< OP_PostIt * > &other, UT_ValArray< OP_PostIt * > &result, Comparator compare) const
 
void sortedUnion (const UT_ValArray< OP_PostIt * > &other, UT_ValArray< OP_PostIt * > &result, ComparatorBool is_less) const
 
void sortedIntersection (const UT_ValArray< OP_PostIt * > &other)
 
void sortedIntersection (const UT_ValArray< OP_PostIt * > &other, Comparator compare)
 
void sortedIntersection (const UT_ValArray< OP_PostIt * > &other, ComparatorBool is_less)
 
void sortedIntersection (const UT_ValArray< OP_PostIt * > &other, UT_ValArray< OP_PostIt * > &result) const
 
void sortedIntersection (const UT_ValArray< OP_PostIt * > &other, UT_ValArray< OP_PostIt * > &result, Comparator compare) const
 
void sortedIntersection (const UT_ValArray< OP_PostIt * > &other, UT_ValArray< OP_PostIt * > &result, ComparatorBool is_less) const
 
void sortedSetDifference (const UT_ValArray< OP_PostIt * > &other)
 
void sortedSetDifference (const UT_ValArray< OP_PostIt * > &other, Comparator compare)
 
void sortedSetDifference (const UT_ValArray< OP_PostIt * > &other, ComparatorBool is_less)
 
void sortedSetDifference (const UT_ValArray< OP_PostIt * > &other, UT_ValArray< OP_PostIt * > &result) const
 
void sortedSetDifference (const UT_ValArray< OP_PostIt * > &other, UT_ValArray< OP_PostIt * > &result, Comparator compare) const
 
void sortedSetDifference (const UT_ValArray< OP_PostIt * > &other, UT_ValArray< OP_PostIt * > &result, ComparatorBool is_less) const
 
int removeZeros ()
 
void collapse ()
 
OP_PostItsum () 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_PostIt * >
 UT_Array (const UT_Array< OP_PostIt * > &a)
 
 UT_Array (UT_Array< OP_PostIt * > &&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_PostIt * > init)
 
 ~UT_Array ()
 
void swap (UT_Array< OP_PostIt * > &other)
 
exint append ()
 
exint append (const OP_PostIt *&t)
 
exint append (OP_PostIt *&&t)
 
exint append (const OP_PostIt *&t, bool check_dup)
 
void append (const OP_PostIt **pt, exint count)
 
void appendMultiple (const OP_PostIt *&t, exint count)
 
exint insert (exint index)
 
exint insert (const OP_PostIt *&t, exint i)
 
exint insert (OP_PostIt *&&t, exint i)
 
exint emplace_back (S &&...s)
 
exint uniqueSortedInsert (const OP_PostIt *&t, Comparator compare)
 
exint uniqueSortedInsert (const OP_PostIt *&t, ComparatorBool is_less={})
 
exint uniqueSortedInsert (OP_PostIt *&&t, Comparator compare)
 
exint uniqueSortedFind (const OP_PostIt *&item, ComparatorBool is_less={}) const
 
exint uniqueSortedFind (const OP_PostIt *&item, Comparator compare) const
 
void merge (const UT_Array< OP_PostIt * > &other, int direction, bool allow_dups, ComparatorBool is_less={})
 
bool hasSortedSubset (const UT_Array< OP_PostIt * > &other, ComparatorBool is_less={}) const
 
bool hasSortedSubset (const UT_Array< OP_PostIt * > &other, Comparator compare) const
 
void sortedUnion (const UT_Array< OP_PostIt * > &other, ComparatorBool is_less={})
 
void sortedUnion (const UT_Array< OP_PostIt * > &other, UT_Array< OP_PostIt * > &result, ComparatorBool is_less={}) const
 
void sortedUnion (const UT_Array< OP_PostIt * > &other, Comparator compare)
 
void sortedUnion (const UT_Array< OP_PostIt * > &other, UT_Array< OP_PostIt * > &result, Comparator compare) const
 
void sortedIntersection (const UT_Array< OP_PostIt * > &other, ComparatorBool is_less={})
 
void sortedIntersection (const UT_Array< OP_PostIt * > &other, UT_Array< OP_PostIt * > &result, ComparatorBool is_less={}) const
 
void sortedIntersection (const UT_Array< OP_PostIt * > &other, Comparator compare)
 
void sortedIntersection (const UT_Array< OP_PostIt * > &other, UT_Array< OP_PostIt * > &result, Comparator compare) const
 
void sortedSetDifference (const UT_Array< OP_PostIt * > &other, ComparatorBool is_less={})
 
void sortedSetDifference (const UT_Array< OP_PostIt * > &other, UT_Array< OP_PostIt * > &result, ComparatorBool is_less={}) const
 
void sortedSetDifference (const UT_Array< OP_PostIt * > &other, Comparator compare)
 
void sortedSetDifference (const UT_Array< OP_PostIt * > &other, UT_Array< OP_PostIt * > &result, Comparator compare) const
 
exint heapPush (const OP_PostIt *&t, Comparator compare)
 
OP_PostItheapPop (Comparator compare)
 
const OP_PostIt *& heapMax () const
 
exint concat (const UT_Array< OP_PostIt * > &a)
 Takes another T array and concatenate it onto my end. More...
 
exint concat (UT_Array< OP_PostIt * > &&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_PostIt *&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_PostIt * > &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_PostIt *&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_PostIt *&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_PostItselectNthLargest (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 shrinkToFit ()
 shrinks the capacity to the current size More...
 
void setSizeAndShrink (exint new_size)
 convenience method to set size and shrink-to-fit in a single call More...
 
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_PostIt * > & operator= (const UT_Array< OP_PostIt * > &a)
 
UT_Array< OP_PostIt * > & operator= (std::initializer_list< OP_PostIt * > ilist)
 Replace the contents with those from the initializer_list ilist. More...
 
UT_Array< OP_PostIt * > & operator= (UT_Array< OP_PostIt * > &&a)
 Move the contents of array a to this array. More...
 
bool operator== (const UT_Array< OP_PostIt * > &a) const
 
bool operator!= (const UT_Array< OP_PostIt * > &a) const
 
bool isEqual (const UT_Array< OP_PostIt * > &a, ComparatorBool is_equal) const
 
int isEqual (const UT_Array< OP_PostIt * > &a, Comparator compare) const
 
OP_PostIt *& operator() (exint i)
 
const OP_PostIt *& operator() (exint i) const
 
OP_PostIt *& operator[] (exint i)
 
const OP_PostIt *& operator[] (exint i) const
 
OP_PostIt *& forcedRef (exint i)
 
OP_PostItforcedGet (exint i) const
 
OP_PostIt *& last ()
 
const OP_PostIt *& last () const
 
exint apply (int(*apply_func)(OP_PostIt *&t, void *d), void *d)
 
OP_PostItaccumulate (const OP_PostIt *&init_value, BinaryOp add) const
 
OP_PostIt ** getArray () const
 
const OP_PostIt ** getRawArray () const
 
OP_PostIt ** array ()
 
const OP_PostIt ** array () const
 
OP_PostIt ** data ()
 
const OP_PostIt ** data () const
 
OP_PostIt ** aliasArray (OP_PostIt **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_PostIt * > &src)
 
void unsafeShareData (OP_PostIt **src, exint srcsize)
 
void unsafeShareData (OP_PostIt **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_PostIt *&t, Comparator compare)
 
exint sortedInsert (const OP_PostIt *&t, ComparatorBool is_less={})
 
exint index (const OP_PostIt *&t) const
 
exint safeIndex (const OP_PostIt *&t) const
 

Additional Inherited Members

- Static Public Member Functions inherited from UT_ValArray< OP_PostIt * >
static bool compareElementsBool (const OP_PostIt *&a, const OP_PostIt *&b)
 
static int compareElements (const OP_PostIt **a, const OP_PostIt **b)
 
static bool isElementZero (const OP_PostIt *&a)
 
- Protected Member Functions inherited from UT_Array< OP_PostIt * >
 UT_Array (const UT_ArrayCT::ExternalCapacity, OP_PostIt **external_data, const exint external_capacity)
 
 UT_Array (const UT_ArrayCT::ExternalMove, OP_PostIt **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_PostIt * >
static constexpr
SYS_FORCE_INLINE bool 
isPOD ()
 
static void construct (OP_PostIt *&dst, S &&...s)
 
static void copyConstruct (OP_PostIt *&dst, const OP_PostIt *&src)
 

Detailed Description

Definition at line 26 of file OP_PostItNoteList.h.

Member Typedef Documentation

Definition at line 29 of file OP_PostItNoteList.h.

Constructor & Destructor Documentation

OP_PostItNoteList::OP_PostItNoteList ( OP_Network net)
OP_PostItNoteList::~OP_PostItNoteList ( )

Member Function Documentation

void OP_PostItNoteList::clearAndDestroy ( )

Remove all network boxes from this list.

OP_PostIt* OP_PostItNoteList::createPostItNote ( const char *  name)

Create a network box with the specified name and insert it into this OP_PostItNoteList at the next available index. Returns a pointer to the OP_PostIt 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_PostItNoteList::deletePostItNote ( OP_PostIt netbox)

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

bool OP_PostItNoteList::deletePostItNote ( int  index)

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

OP_PostIt* OP_PostItNoteList::findPostItNote ( const char *  name) const

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

int OP_PostItNoteList::findPostItNoteIndex ( const char *  name) const

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

int OP_PostItNoteList::findPostItNoteIndex ( OP_PostIt netbox) const

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

int64 OP_PostItNoteList::getMemoryUsage ( bool  inclusive) const

Return the amount of memory owned by this OP_PostItNoteList.

bool OP_PostItNoteList::load ( UT_IStream is,
const char *  path,
bool  path_contains_network,
bool  path_contains_packet_ext,
OP_OverwriteAction  overwrite = OP_NO_OVERWRITE,
OP_PostIt **  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.


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