Classes | Typedefs | Functions
base1_friend.h File Reference
#include "base1.h"

Go to the source code of this file.


struct  base1_st_
struct  base1_vtable_st_


typedef struct base1_private_st_base1_private_handle
typedef struct base1_st_ base1_st
typedef void(* base1_delete_fn )(base1_handle base1_h)
typedef const char *(* base1_type_string_fn )(base1_handle base1_h)
typedef my_rc_e(* base1_string_fn )(base1_handle base1_h, char *buffer, size_t buffer_size)
typedef my_rc_e(* base1_string_size_fn )(base1_handle base1_h, size_t *buffer_size)
typedef my_rc_e(* base1_increase_val3_fn )(base1_handle base1_h)
typedef struct base1_vtable_st_ base1_vtable_st


my_rc_e base1_inherit_vtable (const base1_vtable_st *parent_vtable, base1_vtable_st *child_vtable, bool do_null_check)
my_rc_e base1_set_vtable (base1_handle base1_h, base1_vtable_st *vtable)
void base1_friend_delete (base1_handle base1_h)
my_rc_e base1_init (base1_handle base1_h)

Detailed Description

Matt Miller <>


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 <>.


This is the friend interface for base1 class. It should only be included by sub-classes of base1.

Definition in file base1_friend.h.

Typedef Documentation

typedef void(* base1_delete_fn)(base1_handle base1_h)

Virtual function declaration.

Definition at line 47 of file base1_friend.h.

Virtual function declaration.

Definition at line 71 of file base1_friend.h.

Opaque pointer to reference private data for the class

Definition at line 31 of file base1_friend.h.

typedef struct base1_st_ base1_st

Friend accessible data for this class

typedef my_rc_e(* base1_string_fn)(base1_handle base1_h, char *buffer, size_t buffer_size)

Virtual function declaration.

Definition at line 59 of file base1_friend.h.

typedef my_rc_e(* base1_string_size_fn)(base1_handle base1_h, size_t *buffer_size)

Virtual function declaration.

Definition at line 65 of file base1_friend.h.

typedef const char*(* base1_type_string_fn)(base1_handle base1_h)

Virtual function declaration.

Definition at line 53 of file base1_friend.h.

The virtual table to be specified by friend classes.

See also:

Function Documentation

void base1_friend_delete ( base1_handle  base1_h)

Allow a friend class to delete the base1 object. It is assumed that the friend class is managing the memory for the base1 object and, thus, the object will not be freed. However, members within the base1 object may be freed. This does not call the virtual function table version of delete, but rather the delete specifically for type base1.

base1_hThe object. If NULL, then this function is a no-op.
See also:

Definition at line 281 of file base1.c.

my_rc_e base1_inherit_vtable ( const base1_vtable_st parent_vtable,
base1_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_vtableThe parent vtable from which to inherit.
child_vtableThe child vtable to which functions may be inherited.
do_null_checkIndicates whether an error should be thrown if a function in the child vtable is NULL after inheritance.

Definition at line 382 of file base1.c.

my_rc_e base1_init ( base1_handle  base1_h)

Allows a friend class to initialize their inner base1 object. Must be called before the base1 object is used. If an error is returned, any clean-up was handled internally and there is no need to call a delete function.

base1_hThe object
Return code
See also:

Definition at line 461 of file base1.c.

my_rc_e base1_set_vtable ( base1_handle  base1_h,
base1_vtable_st vtable 

This is a function used by friend classes to set the virtual table according to which methods they wish to override.

base1_hThe object
vtableThe virtual table specification for the friend class. If a function pointer is NULL, then the base1 function is inherited.
Return code

Definition at line 425 of file base1.c.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines