Classes | Defines | Typedefs | Functions
derived1.c File Reference
#include "derived1_friend.h"

Go to the source code of this file.

Classes

struct  derived1_private_st_

Defines

#define DERIVED1_STR_SIZE   256

Typedefs

typedef struct derived1_private_st_ derived1_private_st

Functions

my_rc_e derived1_increase_val4 (derived1_handle derived1_h)
void derived1_friend_delete (derived1_handle derived1_h)
void derived1_delete (derived1_handle derived1_h)
base1_handle derived1_cast_to_base1 (derived1_handle derived1_h)
base2_handle derived1_cast_to_base2 (derived1_handle derived1_h)
my_rc_e derived1_inherit_vtable (const derived1_vtable_st *parent_vtable, derived1_vtable_st *child_vtable, bool do_null_check)
my_rc_e derived1_set_vtable (derived1_handle derived1_h, derived1_vtable_st *vtable)
my_rc_e derived1_init (derived1_handle derived1_h)
derived1_handle derived1_new1 (void)

Detailed Description

Author:
Matt Miller <matt@matthewjmiller.net>

LICENSE

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

DESCRIPTION

This is the implements a class that inherits from base1 and base2.

Definition in file derived1.c.


Define Documentation

#define DERIVED1_STR_SIZE   256

Size for this object to use for base1_string_size_fn

Definition at line 27 of file derived1.c.


Typedef Documentation

Private variables which cannot be directly accessed by any other class including children.


Function Documentation

base1_handle derived1_cast_to_base1 ( derived1_handle  derived1_h)

Cast the derived1 object to base1.

Parameters:
derived1_hThe derived1 object
Returns:
The base1 object

Definition at line 449 of file derived1.c.

base2_handle derived1_cast_to_base2 ( derived1_handle  derived1_h)

Cast the derived1 object to base2.

Parameters:
derived1_hThe derived1 object
Returns:
The base2 object

Definition at line 467 of file derived1.c.

void derived1_delete ( derived1_handle  derived1_h)

Delete the object. This is a virtual function. Upon return, the object is not longer valid.

Parameters:
derived1_hThe object. If NULL, then this function is a no-op.

Definition at line 368 of file derived1.c.

void derived1_friend_delete ( derived1_handle  derived1_h)

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

Parameters:
derived1_hThe object. If NULL, then this function is a no-op.
See also:
derived1_delete()

Definition at line 342 of file derived1.c.

my_rc_e derived1_increase_val4 ( derived1_handle  derived1_h)

Increase val4 for the object. This is a virtual function.

Parameters:
derived1_hThe object
Returns:
Return code

Definition at line 288 of file derived1.c.

my_rc_e derived1_inherit_vtable ( const derived1_vtable_st parent_vtable,
derived1_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.

Parameters:
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 488 of file derived1.c.

my_rc_e derived1_init ( derived1_handle  derived1_h)

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

Parameters:
derived1_hThe object
Returns:
Return code

Definition at line 580 of file derived1.c.

derived1_handle derived1_new1 ( void  )

Create a new derived1 object.

Returns:
The object or NULL if creation failed

Definition at line 648 of file derived1.c.

my_rc_e derived1_set_vtable ( derived1_handle  derived1_h,
derived1_vtable_st vtable 
)

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

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

Definition at line 535 of file derived1.c.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines