The protocol used for this class mimics the way many other collection classes are defined. For example, when used with MFC, you will see member definitions such as c4_View::GetSize, c4_View::GetAt, c4_View::InsertAt.
The elements of views can be referred to by their 0-based index, which produces a row-reference of type c4_RowRef. These row references can be copied, used to get or set properties, or dereferenced (in which case an object of class c4_Row is returned). Taking the address of a row reference produces a c4_Cursor, which acts very much like a pointer.
The following code creates a view with 1 row and 2 properties:
c4_StringProp pName ("Name"); c4_IntProp pAge ("Age");
c4_Row data; pName (data) = "John Williams"; pAge (data) = 43;
c4_View myView; myView.Add(row);
This is similar to c4_View::GroupBy, but it determines only the
number of rows in each group and does not create a nested view.
keys_ the properties in this view determine the grouping name_ name of the new count property defined in result
This can be used to access view data in a generalized way.
Useful for c4_CustomViewers which are based on other views.
row_ row index, range [0 .. GetSize()) col_ property index, range [0 .. NumProperties()) buf_ buffer for the result
This operation is similar to the SQL 'GROUP BY', but it takes
advantage of the fact that Metakit supports nested views. The
view returned from this member has one row per distinct group,
with an extra view property holding the remaining properties.
If there are N rows in the original view matching key X, then
the result is a row for key X, with a subview of N rows. The
properties of the subview are all the properties not in the key.
keys_ the properties in this view determine the grouping name_ name of the new subview defined in result
keys_ the properties in this view determine the join view_ second view participating in the join outer_ true: keep rows with no match in second view
This operation is the inverse of c4_View::GroupBy, expanding
all rows in specified subview and returning a view which looks
as if the rows in each subview were "expanded in place".
sub_ name of the subview to expand outer_ true: keep rows with empty subviews