Coconut Framework  beta
Classes | Enumerations | Functions
CNNumber.h File Reference

Define CNNumber class. More...

#include "CNObject.h"
#include "CNType.h"
#include <stdio.h>
#include <stdint.h>

Go to the source code of this file.

Classes

struct  CNNumberMethods
 Methods for CNNumber class. More...
 
struct  CNNumber
 Number data class. More...
 

Enumerations

enum  CNNumberType { CNBooleanNumberType, CNSignedIntegerNumberType, CNUnsignedIntegerNumberType, CNFloatNumberType }
 Type of the context of the CNNumber. More...
 

Functions

struct CNNumberCNAllocateBooleanNumber (CNBoolean value, struct CNResource *resource)
 Allocate CNNumber object witl boolean value. More...
 
struct CNNumberCNAllocateSignedIntegerNumber (int64_t value, struct CNResource *resource)
 Allocate CNNumber object witl signed integer value. More...
 
struct CNNumberCNAllocateUnsignedIntegerNumber (uint64_t value, struct CNResource *resource)
 Allocate CNNumber object witl unsigned integer value. More...
 
struct CNNumberCNAllocateFloatNumber (double value, struct CNResource *resource)
 Allocate CNNumber object witl floating value. More...
 
static void CNReleaseNumber (struct CNNumber *dst)
 Release CNNumber object. More...
 
static struct CNObjectCNObjectOfNumber (struct CNNumber *src)
 Get super class of CNNumber. More...
 
static CNNumberType CNTypeOfNumber (const struct CNNumber *src)
 Get context data of CNNumber. More...
 
static CNBoolean CNBooleanNumber (const struct CNNumber *src)
 Get boolean value in number object. More...
 
static int64_t CNSignedIntegerNumber (const struct CNNumber *src)
 Get signed integer value in number object. More...
 
static uint64_t CNUnsignedIntegerNumber (const struct CNNumber *src)
 Get unsigned integer value in number object. More...
 
static double CNFloatNumber (const struct CNNumber *src)
 Get floating point value in number object. More...
 
struct CNStringCNNumberToString (struct CNNumber *src, struct CNResource *resource)
 Get string which presents the value of source number. More...
 
void CNPrintNumber (FILE *outfp, const struct CNNumber *src)
 Print number to the file. More...
 

Detailed Description

Define CNNumber class.

Copyright
Copyright (C) 2013 Steel Wheels Project

Enumeration Type Documentation

Type of the context of the CNNumber.

Enumerator
CNBooleanNumberType 

Boolean number

CNSignedIntegerNumberType 

Signed integer number

CNUnsignedIntegerNumberType 

Unsigned integer number

CNFloatNumberType 

Floating point number

Function Documentation

struct CNNumber* CNAllocateBooleanNumber ( CNBoolean  value,
struct CNResource *  resource 
)

Allocate CNNumber object witl boolean value.

Return values
numAllocated object
NULLAllocation failed
Parameters
valueInitial value
resourceResource to allocate the object
struct CNNumber* CNAllocateSignedIntegerNumber ( int64_t  value,
struct CNResource *  resource 
)

Allocate CNNumber object witl signed integer value.

Return values
numAllocated object
NULLAllocation failed
Parameters
valueInitial value
resourceResource to allocate the object
struct CNNumber* CNAllocateUnsignedIntegerNumber ( uint64_t  value,
struct CNResource *  resource 
)

Allocate CNNumber object witl unsigned integer value.

Return values
numAllocated object
NULLAllocation failed
Parameters
valueInitial value
resourceResource to allocate the object
struct CNNumber* CNAllocateFloatNumber ( double  value,
struct CNResource *  resource 
)

Allocate CNNumber object witl floating value.

Return values
numAllocated object
NULLAllocation failed
Parameters
valueInitial value
resourceResource to allocate the object
static void CNReleaseNumber ( struct CNNumber dst)
inlinestatic

Release CNNumber object.

Parameters
dstDestination object

References CNReleaseObject(), and CNNumber::superClass.

static struct CNObject* CNObjectOfNumber ( struct CNNumber src)
static

Get super class of CNNumber.

Returns
Super class
Parameters
srcSource number

References CNNumber::superClass.

static CNNumberType CNTypeOfNumber ( const struct CNNumber src)
inlinestatic

Get context data of CNNumber.

Returns
Type of the number
Parameters
srcSource number object

References CNNumber::numberType.

static CNBoolean CNBooleanNumber ( const struct CNNumber src)
inlinestatic

Get boolean value in number object.

Returns
Boolean value
Parameters
srcSource number object

References CNNumber::booleanValue.

static int64_t CNSignedIntegerNumber ( const struct CNNumber src)
inlinestatic

Get signed integer value in number object.

Returns
Context value
Parameters
srcSource number object

References CNNumber::signedIntegerValue.

static uint64_t CNUnsignedIntegerNumber ( const struct CNNumber src)
inlinestatic

Get unsigned integer value in number object.

Returns
Context value
Parameters
srcSource number object

References CNNumber::unsignedIntegerValue.

static double CNFloatNumber ( const struct CNNumber src)
inlinestatic

Get floating point value in number object.

Returns
Context value
Parameters
srcSource number object

References CNNumber::floatValue.

struct CNString* CNNumberToString ( struct CNNumber src,
struct CNResource *  resource 
)

Get string which presents the value of source number.

Returns
String
Parameters
srcSource number
resourceResource to allocate the string
void CNPrintNumber ( FILE *  outfp,
const struct CNNumber src 
)

Print number to the file.

Parameters
outfpOutput file
srcSource number object