JX Application Framework
Loading...
Searching...
No Matches
Public Member Functions | List of all members
JPackedTableData< T > Class Template Reference

#include <JPackedTableData.h>

Inheritance diagram for JPackedTableData< T >:
[legend]

Public Member Functions

 JPackedTableData (const T &defValue)
 
 JPackedTableData (const JPackedTableData< T > &source)
 
 ~JPackedTableData () override
 
const JRunArray< T > & GetData () const
 
GetItem (const JIndex row, const JIndex col) const
 
GetItem (const JPoint &cell) const
 
void SetItem (const JIndex row, const JIndex col, const T &data)
 
void SetItem (const JPoint &cell, const T &data)
 
void GetRow (const JIndex index, JList< T > *rowData) const
 
void SetRow (const JIndex index, const JList< T > &rowData)
 
void SetRow (const JIndex index, const T &data)
 
void SetPartialRow (const JIndex rowIndex, const JIndex firstColIndex, const JIndex lastColIndex, const T &data)
 
void GetCol (const JIndex index, JList< T > *colData) const
 
void SetCol (const JIndex index, const JList< T > &colData)
 
void SetCol (const JIndex index, const T &data)
 
void SetPartialCol (const JIndex colIndex, const JIndex firstRowIndex, const JIndex lastRowIndex, const T &data)
 
void SetRect (const JRect &rect, const T &data)
 
void SetRect (const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h, const T &data)
 
void ApplyToRect (const JRect &rect, T(*f)(const T &))
 
void ApplyToRect (const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h, T(*f)(const T &))
 
void InsertRows (const JIndex index, const JSize count, const JList< T > *initData=nullptr)
 
void PrependRows (const JSize count, const JList< T > *initData=nullptr)
 
void AppendRows (const JSize count, const JList< T > *initData=nullptr)
 
void DuplicateRow (const JIndex origIndex, const JIndex newIndex)
 
void RemoveRow (const JIndex index)
 
void RemoveNextRows (const JIndex firstIndex, const JSize count)
 
void RemovePrevRows (const JIndex lastIndex, const JSize count)
 
void RemoveAllRows ()
 
void MoveRow (const JIndex origIndex, const JIndex newIndex)
 
void InsertCols (const JIndex index, const JSize count, const JList< T > *initData=nullptr)
 
void PrependCols (const JSize count, const JList< T > *initData=nullptr)
 
void AppendCols (const JSize count, const JList< T > *initData=nullptr)
 
void DuplicateCol (const JIndex origIndex, const JIndex newIndex)
 
void RemoveCol (const JIndex index)
 
void RemoveNextCols (const JIndex firstIndex, const JSize count)
 
void RemovePrevCols (const JIndex lastIndex, const JSize count)
 
void RemoveAllCols ()
 
void MoveCol (const JIndex origIndex, const JIndex newIndex)
 
void SetAllElements (const T &data)
 
void ClearAllElements ()
 
bool AllItemsEqual (T *data=nullptr) const
 
JSize CountElementsWithValue (const T &data) const
 
const T GetDefaultValue () const
 
void SetDefaultValue (const T &data)
 
- Public Member Functions inherited from JTableData
 JTableData ()
 
 JTableData (const JTableData &source)
 
 ~JTableData () override
 
JTableDataoperator= (const JTableData &source)
 
bool IsEmpty () const
 
JSize GetRowCount () const
 
bool RowIndexValid (const JIndex index) const
 
JSize GetColCount () const
 
bool ColIndexValid (const JIndex index) const
 
bool CellValid (const JPoint &cell) const
 
- Public Member Functions inherited from JBroadcaster
 JBroadcaster ()
 
virtual ~JBroadcaster ()
 
JBroadcasteroperator= (const JBroadcaster &source)
 
bool HasSenders () const
 
JSize GetSenderCount () const
 
bool HasRecipients () const
 
JSize GetRecipientCount () const
 
virtual JString ToString () const
 
template<class T >
void ListenTo (const JBroadcaster *sender, const std::function< void(const T &)> &f)
 

Additional Inherited Members

- Static Public Attributes inherited from JTableData
static const JUtf8BytekRowsInserted = "RowsInserted::JTableData"
 
static const JUtf8BytekRowDuplicated = "RowDuplicated::JTableData"
 
static const JUtf8BytekRowsRemoved = "RowsRemoved::JTableData"
 
static const JUtf8BytekRowMoved = "RowMoved::JTableData"
 
static const JUtf8BytekColsInserted = "ColsInserted::JTableData"
 
static const JUtf8BytekColDuplicated = "ColDuplicated::JTableData"
 
static const JUtf8BytekColsRemoved = "ColsRemoved::JTableData"
 
static const JUtf8BytekColMoved = "ColMoved::JTableData"
 
static const JUtf8BytekRectChanged = "RectChanged::JTableData"
 
- Protected Member Functions inherited from JTableData
void RowsAdded (const JSize count)
 
void RowsDeleted (const JSize count)
 
void SetRowCount (const JSize newRowCount)
 
void ColsAdded (const JSize count)
 
void ColsDeleted (const JSize count)
 
void SetColCount (const JSize newColCount)
 
- Protected Member Functions inherited from JBroadcaster
 JBroadcaster (const JBroadcaster &source)
 
void ListenTo (const JBroadcaster *sender)
 
void StopListening (const JBroadcaster *sender)
 
void ClearWhenGoingAway (const JBroadcaster *sender, void *pointerToMember)
 
void StopListening (const JBroadcaster *sender, const std::type_info &messageType)
 
template<class T >
void Send (JBroadcaster *recipient, const T &message)
 
template<class T >
void Broadcast (const T &message)
 
virtual void Receive (JBroadcaster *sender, const Message &message)
 
void SendWithFeedback (JBroadcaster *recipient, Message *message)
 
void BroadcastWithFeedback (Message *message)
 
virtual void ReceiveWithFeedback (JBroadcaster *sender, Message *message)
 
virtual void ReceiveGoingAway (JBroadcaster *sender)
 

Constructor & Destructor Documentation

◆ JPackedTableData() [1/2]

template<class T >
JPackedTableData< T >::JPackedTableData ( const T &  defValue)

Template for storing values and structs in a table. The data is grouped by column into a single JRunArray.

Since we use a JRunArray, this class cannot be use to store objects.
Use JObjTableData instead.

◆ JPackedTableData() [2/2]

template<class T >
JPackedTableData< T >::JPackedTableData ( const JPackedTableData< T > &  source)

◆ ~JPackedTableData()

template<class T >
JPackedTableData< T >::~JPackedTableData ( )
override

Member Function Documentation

◆ AllItemsEqual()

template<class T >
bool JPackedTableData< T >::AllItemsEqual ( T *  data = nullptr) const

If all the elements are equal, this function returns true and sets data to the single value.

If there are no elements, it returns false, mainly because the second version of the function doesn't have any data to return.

◆ AppendCols()

template<class T >
void JPackedTableData< T >::AppendCols ( const JSize  count,
const JList< T > *  initData = nullptr 
)

◆ AppendRows()

template<class T >
void JPackedTableData< T >::AppendRows ( const JSize  count,
const JList< T > *  initData = nullptr 
)

◆ ApplyToRect() [1/2]

template<class T >
void JPackedTableData< T >::ApplyToRect ( const JCoordinate  x,
const JCoordinate  y,
const JCoordinate  w,
const JCoordinate  h,
T(*)(const T &)  f 
)

◆ ApplyToRect() [2/2]

template<class T >
void JPackedTableData< T >::ApplyToRect ( const JRect rect,
T(*)(const T &)  f 
)

This ought to be done one -run- at a time, and should be implemented in JRunArray.

◆ ClearAllElements()

template<class T >
void JPackedTableData< T >::ClearAllElements ( )

Sets all elements to the default value.

◆ CountElementsWithValue()

template<class T >
JSize JPackedTableData< T >::CountElementsWithValue ( const T &  data) const

◆ DuplicateCol()

template<class T >
void JPackedTableData< T >::DuplicateCol ( const JIndex  origIndex,
const JIndex  newIndex 
)

◆ DuplicateRow()

template<class T >
void JPackedTableData< T >::DuplicateRow ( const JIndex  origIndex,
const JIndex  newIndex 
)

◆ GetCol()

template<class T >
void JPackedTableData< T >::GetCol ( const JIndex  index,
JList< T > *  colData 
) const

◆ GetData()

template<class T >
const JRunArray< T > & JPackedTableData< T >::GetData ( ) const

◆ GetDefaultValue()

template<class T >
const T JPackedTableData< T >::GetDefaultValue ( ) const

◆ GetItem() [1/2]

template<class T >
T JPackedTableData< T >::GetItem ( const JIndex  row,
const JIndex  col 
) const

◆ GetItem() [2/2]

template<class T >
T JPackedTableData< T >::GetItem ( const JPoint cell) const

◆ GetRow()

template<class T >
void JPackedTableData< T >::GetRow ( const JIndex  index,
JList< T > *  rowData 
) const

◆ InsertCols()

template<class T >
void JPackedTableData< T >::InsertCols ( const JIndex  index,
const JSize  count,
const JList< T > *  initData = nullptr 
)

◆ InsertRows()

template<class T >
void JPackedTableData< T >::InsertRows ( const JIndex  index,
const JSize  count,
const JList< T > *  initData = nullptr 
)

◆ MoveCol()

template<class T >
void JPackedTableData< T >::MoveCol ( const JIndex  origIndex,
const JIndex  newIndex 
)

◆ MoveRow()

template<class T >
void JPackedTableData< T >::MoveRow ( const JIndex  origIndex,
const JIndex  newIndex 
)

◆ PrependCols()

template<class T >
void JPackedTableData< T >::PrependCols ( const JSize  count,
const JList< T > *  initData = nullptr 
)

◆ PrependRows()

template<class T >
void JPackedTableData< T >::PrependRows ( const JSize  count,
const JList< T > *  initData = nullptr 
)

◆ RemoveAllCols()

template<class T >
void JPackedTableData< T >::RemoveAllCols ( )

◆ RemoveAllRows()

template<class T >
void JPackedTableData< T >::RemoveAllRows ( )

◆ RemoveCol()

template<class T >
void JPackedTableData< T >::RemoveCol ( const JIndex  index)

◆ RemoveNextCols()

template<class T >
void JPackedTableData< T >::RemoveNextCols ( const JIndex  firstIndex,
const JSize  count 
)

◆ RemoveNextRows()

template<class T >
void JPackedTableData< T >::RemoveNextRows ( const JIndex  firstIndex,
const JSize  count 
)

◆ RemovePrevCols()

template<class T >
void JPackedTableData< T >::RemovePrevCols ( const JIndex  lastIndex,
const JSize  count 
)

◆ RemovePrevRows()

template<class T >
void JPackedTableData< T >::RemovePrevRows ( const JIndex  lastIndex,
const JSize  count 
)

◆ RemoveRow()

template<class T >
void JPackedTableData< T >::RemoveRow ( const JIndex  index)

◆ SetAllElements()

template<class T >
void JPackedTableData< T >::SetAllElements ( const T &  data)

◆ SetCol() [1/2]

template<class T >
void JPackedTableData< T >::SetCol ( const JIndex  index,
const JList< T > &  colData 
)

◆ SetCol() [2/2]

template<class T >
void JPackedTableData< T >::SetCol ( const JIndex  index,
const T &  data 
)

◆ SetDefaultValue()

template<class T >
void JPackedTableData< T >::SetDefaultValue ( const T &  data)

◆ SetItem() [1/2]

template<class T >
void JPackedTableData< T >::SetItem ( const JIndex  row,
const JIndex  col,
const T &  data 
)

◆ SetItem() [2/2]

template<class T >
void JPackedTableData< T >::SetItem ( const JPoint cell,
const T &  data 
)

◆ SetPartialCol()

template<class T >
void JPackedTableData< T >::SetPartialCol ( const JIndex  colIndex,
const JIndex  firstRowIndex,
const JIndex  lastRowIndex,
const T &  data 
)

◆ SetPartialRow()

template<class T >
void JPackedTableData< T >::SetPartialRow ( const JIndex  rowIndex,
const JIndex  firstColIndex,
const JIndex  lastColIndex,
const T &  data 
)

◆ SetRect() [1/2]

template<class T >
void JPackedTableData< T >::SetRect ( const JCoordinate  x,
const JCoordinate  y,
const JCoordinate  w,
const JCoordinate  h,
const T &  data 
)

◆ SetRect() [2/2]

template<class T >
void JPackedTableData< T >::SetRect ( const JRect rect,
const T &  data 
)

◆ SetRow() [1/2]

template<class T >
void JPackedTableData< T >::SetRow ( const JIndex  index,
const JList< T > &  rowData 
)

◆ SetRow() [2/2]

template<class T >
void JPackedTableData< T >::SetRow ( const JIndex  index,
const T &  data 
)

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