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

Go to the source code of this file.

Classes

struct  base1_public_data_st_

Typedefs

typedef struct base1_st_base1_handle
typedef struct
base1_public_data_st_ 
base1_public_data_st

Functions

const char * base1_get_val1_description (void)
my_rc_e base1_get_public_data (base1_handle base1_h, base1_public_data_st *public_data)
my_rc_e base1_set_public_data (base1_handle base1_h, base1_public_data_st *public_data)
my_rc_e base1_increase_val3 (base1_handle base1_h)
base1_handle base1_new1 (void)
base1_handle base1_new2 (base1_public_data_st *public_data)
base1_handle base1_new3 (uint8_t val1, uint32_t val3)
void base1_delete (base1_handle base1_h)
const char * base1_type_string (base1_handle base1_h)
my_rc_e base1_string (base1_handle base1_h, char *buffer, size_t buffer_size)
my_rc_e base1_string_size (base1_handle base1_h, size_t *buffer_size)

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 public interface for base1 class.

Definition in file base1.h.


Typedef Documentation

typedef struct base1_st_* base1_handle

Opaque pointer to reference instances of this class

Definition at line 30 of file base1.h.

Public data for the class


Function Documentation

void base1_delete ( base1_handle  base1_h)

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

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

Definition at line 307 of file base1.c.

my_rc_e base1_get_public_data ( base1_handle  base1_h,
base1_public_data_st public_data 
)

Gets a copy of the public data for the given object. Note this is a shallow copy of the data, modifying it will not change the object's state. Writing the object's state is handled seperately by base1_set_public_data().

Parameters:
base1_hThe object
public_dataThe data buffer into which the values should be read
Returns:
Return code
See also:
base1_set_public_data()

Definition at line 59 of file base1.c.

const char* base1_get_val1_description ( void  )

Example of a static class method. It takes no instance of an object.

Returns:
Description of val1

Definition at line 43 of file base1.c.

my_rc_e base1_increase_val3 ( base1_handle  base1_h)

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

Parameters:
base1_hThe object
Returns:
Return code

Definition at line 347 of file base1.c.

base1_handle base1_new1 ( void  )

Create a new base1 object.

Returns:
The object or NULL if creation failed

Definition at line 499 of file base1.c.

base1_handle base1_new2 ( base1_public_data_st public_data)

Create a new base1 object.

Parameters:
public_dataThe initial public data for the new object.
Returns:
The object or NULL if creation failed

Definition at line 529 of file base1.c.

base1_handle base1_new3 ( uint8_t  val1,
uint32_t  val3 
)

Create a new base1 object.

Parameters:
val1The initial val1 for the new object.
val3The initial val3 for the new object.
Returns:
The object or NULL if creation failed

Definition at line 554 of file base1.c.

my_rc_e base1_set_public_data ( base1_handle  base1_h,
base1_public_data_st public_data 
)

Set the public data for the given object. Note that this creates a deep copy of the data in the object. Also note that it overwrites all public data in the object, not certain fields seletively.

Parameters:
base1_hThe object
public_dataThe data buffer whose values should be written into the object
Returns:
Return code
See also:
base1_get_public_data()

Definition at line 85 of file base1.c.

my_rc_e base1_string ( base1_handle  base1_h,
char *  buffer,
size_t  buffer_size 
)

Get a string representation of the object. This is a virtual function.

Parameters:
base1_hThe object
bufferThe buffer in which to put the string.
buffer_sizeThe size of the buffer.
Returns:
Return code
See also:
base1_string_size()

Definition at line 186 of file base1.c.

my_rc_e base1_string_size ( base1_handle  base1_h,
size_t *  buffer_size 
)

Get the minimum size of a string buffer that should be used to get a string representation of the object. This is a virtual function.

Parameters:
base1_hThe object
buffer_sizeOutputs the size of the buffer that should be used.
Returns:
Return code
See also:
base1_string()

Definition at line 109 of file base1.c.

const char* base1_type_string ( base1_handle  base1_h)

Get the string describing the type of the object. This is a virtual function.

Parameters:
base1_hThe object
Returns:
The string indicating the object type.

Definition at line 164 of file base1.c.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines