Main Page | Modules | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

attn_dml_read.c File Reference


Detailed Description

ALP attention manager data model read implementation.

#include <time.h>
#include <unistd.h>
#include <hiker/types.h>
#include <hiker/prv/attnmgr_traces.h>
#include <hiker/prv/attnmgr_dml.h>
#include "attn_dml_prv.h"

Defines

#define _XOPEN_SOURCE

Functions

alp_status_t alp_attn_dml_alert_statement_begin (AlpDmlH dmlH, AlpDmlStatementH *stmtH, char *source, char *name, char *handle, AlpLuid alertLuid, AlpAttnDmlOrderByType orderBy, uint32_t *numResults)
 Creates and initializes a new AlpDmlStatementH that can be used to iterate over a set of AlertItem's in the Attention data model.
alp_status_t alp_attn_dml_prop_statement_begin (AlpDmlH dmlH, AlpDmlStatementH *stmtH, AlpLuid alertLuid, AlpLuid propLuid, char *property, uint32_t *numResults)
 Creates and initializes a new AlpDmlStatementH that can be used to iterate over a set of PropertyItem's in the Attention data model.
alp_status_t alp_attn_dml_statement_next (AlpDmlStatementH stmtH)
 Given a statement handle initialized with alp_attn_dml_*_statement_init() API, this routine will step the statement forward to point to the next item in the sequence.
alp_status_t alp_attn_dml_statement_end (AlpDmlStatementH stmtH)
 Close/end the selection statement.
alp_status_t alp_attn_dml_statement_get_int32 (AlpDmlStatementH stmtH, AlpAttnDmlColumnType column, int32_t *value)
 Get a int32_t from the current statement record statementH must be from a previous call to begin.
alp_status_t alp_attn_dml_statement_get_uint32 (AlpDmlStatementH stmtH, AlpAttnDmlColumnType column, uint32_t *value)
 Get a uint32_t from the current statement record statementH must be from a previous call to begin.
alp_status_t alp_attn_dml_statement_get_int64 (AlpDmlStatementH stmtH, AlpAttnDmlColumnType column, int64_t *value)
 Get a int64_t from the current statement record statementH must be from a previous call to begin.
alp_status_t alp_attn_dml_statement_get_bool (AlpDmlStatementH stmtH, AlpAttnDmlColumnType column, bool *value)
 Get a bool from the current statement record statementH must be from a previous call to begin.
alp_status_t alp_attn_dml_statement_get_string (AlpDmlStatementH stmtH, AlpAttnDmlColumnType column, char **value)
 @ brief Get a text string from the current statement record statementH must be from a previous call to begin
alp_status_t alp_attn_dml_statement_get_blob (AlpDmlStatementH stmtH, AlpAttnDmlColumnType column, bool copy, void **value, uint32_t *size)
 Given a statement handle that has been initialized and stepped using alp_attn_dml_statement_next() where an item has been found, this function can be used to retrieve any integer field from the item located at the current statement position.
alp_status_t alp_attn_dml_statement_get_timestamp (AlpDmlStatementH stmtH, AlpAttnDmlColumnType column, time_t *value)
 Get the timestamp from the current statement record statementH must be from a previous call to begin.
alp_status_t alp_attn_dml_statement_get_luid (AlpDmlStatementH stmtH, AlpLuid *itemLuid)
 Get the luid from the current statement record.


Define Documentation

#define _XOPEN_SOURCE
 


Function Documentation

alp_status_t alp_attn_dml_alert_statement_begin AlpDmlH  dmlH,
AlpDmlStatementH stmtH,
char *  source,
char *  name,
char *  handle,
AlpLuid  alertLuid,
AlpAttnDmlOrderByType  orderBy,
uint32_t *  numResults
 

Creates and initializes a new AlpDmlStatementH that can be used to iterate over a set of AlertItem's in the Attention data model.

After calling this routine, you must call alp_attn_dml_statement_next() to advance the statement to the first object in the result set before you can call any of the alp_attn_dml_statement_get_* API to retrieve information from an object.

It is important to keep track of which alp_attn_dml_*_statement_begin function you use to initialize which AlpDmlStatementH, because that will dictate which objects are included in the statement's result set, and what AlpAttnDmlColumnType's you can use to fetch values from items in the statement.

If there are no records found that match the search critereon, numResults, if it was supplied will be set to 0, ALP_STATUS_ATTN_DML_NO_RECORDS will be returned, and the stmtH parameter will not be initialized (so the caller should not call alp_attn_dml_statement_next (or end) on it.

The AlpDmlH handle must have been initialized by a previously opened.

Parameters:
[in] an AlpDmlH structure which is an AlpSALHandle
[out] a pointer to an AlpDmlStatementH, which is an AlpSALStatement
[in] result order specification
[out] an integer indicating the number of items found
See also:
alp_attn_dml_statement_next

alp_attn_dml_statement_end

Returns:
alp_status_t

alp_status_t alp_attn_dml_prop_statement_begin AlpDmlH  dmlH,
AlpDmlStatementH stmtH,
AlpLuid  alertLuid,
AlpLuid  propLuid,
char *  property,
uint32_t *  numResults
 

Creates and initializes a new AlpDmlStatementH that can be used to iterate over a set of PropertyItem's in the Attention data model.

After calling this routine, you must call alp_attn_dml_statement_next() to advance the statement to the first object in the result set before you can call any of the alp_attn_dml_statement_get_* API to retrieve information from an object.

It is important to keep track of which alp_attn_dml_*_statement_begin function you use to initialize which AlpDmlStatementH, because that will dictate which objects are included in the statement's result set, and what AlpAttnDmlColumnType's you can use to fetch values from items in the statement.

If there are no records found that match the search critereon, numResults, if it was supplied will be set to 0, ALP_STATUS_ATTN_DML_NO_RECORDS will be returned, and the stmtH parameter will not be initialized (so the caller should not call alp_attn_dml_statement_next (or end) on it.

The AlpDmlH handle must have been initialized by a previously opened.

Parameters:
[in] an AlpDmlH structure which is an AlpSALHandle
[out] a pointer to an AlpDmlStatementH, which is an AlpSALStatement
[in] an optional alertLuid to limit the result set.
[in] an optional propLuid to limit the result set.
[in] an optional property spec to limit the result set.
[out] an integer indicating the number of items found
See also:
alp_attn_dml_statement_next

alp_attn_dml_statement_end

Returns:
alp_status_t

alp_status_t alp_attn_dml_statement_end AlpDmlStatementH  stmtH  ) 
 

Close/end the selection statement.

stmtH must be from a previous call to begin

Parameters:
[in] a pointer to an AlpDmlStatementH, which is an AlpSALStatement
Returns:
alp_status_t
See also:
alp_attn_dml_statement_begin

alp_attn_dml_statement_next

alp_status_t alp_attn_dml_statement_get_blob AlpDmlStatementH  stmtH,
AlpAttnDmlColumnType  column,
bool  copy,
void **  value,
uint32_t *  size
 

Given a statement handle that has been initialized and stepped using alp_attn_dml_statement_next() where an item has been found, this function can be used to retrieve any integer field from the item located at the current statement position.

Parameters:
[in] stmtH an AlpDmlStatementH, which is an AlpSALStatement
[in] column an AlpAttnColumnType to specify the field to get the value from
[out] value the char* (string) value of the field
Returns:
alp_status_t

alp_status_t alp_attn_dml_statement_get_bool AlpDmlStatementH  stmtH,
AlpAttnDmlColumnType  column,
bool *  value
 

Get a bool from the current statement record statementH must be from a previous call to begin.

Parameters:
[in] an AlpDmlStatementH, which is an AlpSALStatement
[in] an AlpAttnColumnType to specify the field to get the value from
[out] the bool value of the field
Returns:
alp_status_t

alp_status_t alp_attn_dml_statement_get_int32 AlpDmlStatementH  stmtH,
AlpAttnDmlColumnType  column,
int32_t *  value
 

Get a int32_t from the current statement record statementH must be from a previous call to begin.

Parameters:
[in] an AlpDmlStatementH, which is an AlpSALStatement
[in] an AlpAttnColumnType to specify the field to get the value from
[out] the int32_t value of the field
Returns:
alp_status_t

alp_status_t alp_attn_dml_statement_get_int64 AlpDmlStatementH  stmtH,
AlpAttnDmlColumnType  column,
int64_t *  value
 

Get a int64_t from the current statement record statementH must be from a previous call to begin.

Parameters:
[in] an AlpDmlStatementH, which is an AlpSALStatement
[in] an AlpAttnColumnType to specify the field to get the value from
[out] the int64_t value of the field
Returns:
alp_status_t

alp_status_t alp_attn_dml_statement_get_luid AlpDmlStatementH  stmtH,
AlpLuid itemLuid
 

Get the luid from the current statement record.

stmtH must be from a previous call to begin

Parameters:
[in] an AlpDmlStatementH, which is an AlpSALStatement
[out] the item luid value from the record
Returns:
alp_status_t

alp_status_t alp_attn_dml_statement_get_string AlpDmlStatementH  stmtH,
AlpAttnDmlColumnType  column,
char **  value
 

@ brief Get a text string from the current statement record statementH must be from a previous call to begin

Parameters:
[in] an AlpDmlStatementH, which is an AlpSALStatement
[in] an AlpAttnColumnType to specify the field to get the value from
[out] the char* (string) value of the field
Returns:
alp_status_t

alp_status_t alp_attn_dml_statement_get_timestamp AlpDmlStatementH  stmtH,
AlpAttnDmlColumnType  column,
time_t *  value
 

Get the timestamp from the current statement record statementH must be from a previous call to begin.

Parameters:
[in] an AlpDmlStatementH, which is an AlpSALStatement
[in] an AlpAttnColumnType to specify the field to get the value from
[out] the timestamp value from the record
Returns:
alp_status_t

alp_status_t alp_attn_dml_statement_get_uint32 AlpDmlStatementH  stmtH,
AlpAttnDmlColumnType  column,
uint32_t *  value
 

Get a uint32_t from the current statement record statementH must be from a previous call to begin.

Parameters:
[in] stmtH an AlpDmlStatementH, which is an AlpSALStatement
[in] column an AlpAttnColumnType to specify the field to get the value from
[out] value the uint32_t value of the field
Returns:
alp_status_t

alp_status_t alp_attn_dml_statement_next AlpDmlStatementH  stmtH  ) 
 

Given a statement handle initialized with alp_attn_dml_*_statement_init() API, this routine will step the statement forward to point to the next item in the sequence.

Note that you must call this API in order to get to the first element in the list.

Parameters:
[in] stmtH Statement handle that has been initialized with alp_attn_dml_*_statement_init() API
Returns:
alp_status_t
See also:
alp_attn_dml_statement_begin

alp_attn_dml_statement_end


Generated on Sat Dec 16 20:29:48 2006 for hiker-0.9 by  doxygen 1.4.4