#include "base2.h"
Go to the source code of this file.
Classes | |
struct | base2_st_ |
struct | base2_vtable_st_ |
Typedefs | |
typedef struct base2_private_st_ * | base2_private_handle |
typedef struct base2_st_ | base2_st |
typedef void(* | base2_delete_fn )(base2_handle base2_h) |
typedef my_rc_e(* | base2_increase_val1_fn )(base2_handle base2_h) |
typedef const char *(* | base2_type_string_fn )(base2_handle base2_h) |
typedef my_rc_e(* | base2_string_fn )(base2_handle base2_h, char *buffer, size_t buffer_size) |
typedef my_rc_e(* | base2_string_size_fn )(base2_handle base2_h, size_t *buffer_size) |
typedef struct base2_vtable_st_ | base2_vtable_st |
Functions | |
my_rc_e | base2_inherit_vtable (const base2_vtable_st *parent_vtable, base2_vtable_st *child_vtable, bool do_null_check) |
my_rc_e | base2_set_vtable (base2_handle base2_h, base2_vtable_st *vtable) |
void | base2_friend_delete (base2_handle base2_h) |
my_rc_e | base2_init (base2_handle base2_h) |
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
This is the friend interface for base2 class. It should only be included by sub-classes of base2.
Definition in file base2_friend.h.
typedef void(* base2_delete_fn)(base2_handle base2_h) |
Virtual function declaration.
Definition at line 45 of file base2_friend.h.
typedef my_rc_e(* base2_increase_val1_fn)(base2_handle base2_h) |
Virtual function declaration.
Definition at line 51 of file base2_friend.h.
typedef struct base2_private_st_* base2_private_handle |
Opaque pointer to reference private data for the class
Definition at line 31 of file base2_friend.h.
typedef my_rc_e(* base2_string_fn)(base2_handle base2_h, char *buffer, size_t buffer_size) |
Virtual function declaration.
Definition at line 63 of file base2_friend.h.
typedef my_rc_e(* base2_string_size_fn)(base2_handle base2_h, size_t *buffer_size) |
Virtual function declaration.
Definition at line 69 of file base2_friend.h.
typedef const char*(* base2_type_string_fn)(base2_handle base2_h) |
Virtual function declaration.
Definition at line 57 of file base2_friend.h.
typedef struct base2_vtable_st_ base2_vtable_st |
The virtual table to be specified by friend classes.
void base2_friend_delete | ( | base2_handle | base2_h | ) |
Allow a friend class to delete the base2 object. It is assumed that the friend class is managing the memory for the base2 object and, thus, the object will not be freed. However, members within the base2 object may be freed. This does not call the virtual function table version of delete, but rather the delete specifically for type base2.
base2_h | The object. If NULL, then this function is a no-op. |
my_rc_e base2_inherit_vtable | ( | const base2_vtable_st * | parent_vtable, |
base2_vtable_st * | child_vtable, | ||
bool | do_null_check | ||
) |
Fill in the child vtable with values inherited from the parent_vtable for all functions left NULL in the child vtable.
parent_vtable | The parent vtable from which to inherit. |
child_vtable | The child vtable to which functions may be inherited. |
do_null_check | Indicates whether an error should be thrown if a function in the child vtable is NULL after inheritance. |
my_rc_e base2_init | ( | base2_handle | base2_h | ) |
Allows a friend class to initialize their inner base2 object. Must be called before the base2 object is used. If an error is returned, any clean-up was handled internally and there is no need to call a delete function.
base2_h | The object |
my_rc_e base2_set_vtable | ( | base2_handle | base2_h, |
base2_vtable_st * | vtable | ||
) |
This is a function used by friend classes to set the virtual table according to which methods they wish to override.
base2_h | The object |
vtable | The virtual table specification for the friend class. If a function pointer is NULL, then the base2 function is inherited. |