IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Opened 21 years ago

Closed 21 years ago

Last modified 21 years ago

#391 closed enhancement (fixed)

config file NULL value syntax

Reported by: jhoblitt Owned by: eugene
Priority: high Milestone:
Component: IPP SDRS Version: unspecified
Severity: minor Keywords:
Cc:

Description

How are NULL, NAN, or INF values declared?

Change History (9)

comment:1 by jhoblitt, 21 years ago

dependson: 317

comment:2 by jhoblitt, 21 years ago

psMetadataItem will have to be modified to indicate if a char* or int is 'NULL'.

I'd like to propose a change similar to this:

typedef enum {

PS_NORMAL,
PS_NULL,
PS_NAN,
PS_POSINF,
PS_NEGINF

}
psMetadataState;

typedef struct psMetadataItem
{

const psS32 id; /< Unique ID for metadata item.

char *name; /< Name of metadata item.

psMetadataType type; /< Type of metadata item.
psMetadataState state;
/< Indicates if data is defined.
union {

psBool B; /< boolean data
psS32 S32;
/< Signed 32-bit integer data.
psF32 F32; /< Single-precision float data.
psF64 F64;
/< Double-precision float data.
psList *list; /< List data.
psMetadata *md;
/< Metadata data.
psPtr V; /< Pointer to other type of data.

} data; /< Union for data types.
char *comment;
/< Optional comment ("", not NULL).

}
psMetadataItem;

psMetadataState isn't a great name but it seemed less confusing then something
like psMetaMetadata.

comment:3 by jhoblitt, 21 years ago

I forgot to add that a possible alternative is to reserve a couple of bits in
psMetadataType to indicate this information.

comment:4 by eugene, 21 years ago

Status: newassigned

I prefer the option of bits, or bit values, in psMetadataType. For any data
type except the primitives, the values NAN, POSINF, NEGINF are meaningless. It
might make sense to define these special values as bits associated with the
primitive type range (and possibly even part of PS_TYPE). eg:

PS_TYPE_S8 0x0000
PS_TYPE_S16 0x0001
PS_TYPE_S32 0x0002
..
PS_TYPE_C64 0x000d
PS_TYPE_BOOL 0x000e
PS_TYPE_NULL 0x0010
PS_TYPE_NAN 0x0020
PS_TYPE_POSINF 0x0040
PS_TYPE_NEGINF 0x0080
..

comment:5 by jhoblitt, 21 years ago

I'm not sure that I follow your proposal... psType no longer has any
relationship with psMetadataItem. What am I missing?

comment:6 by jhoblitt, 21 years ago

Did we settle on adding a 'psMetadataFlags flags' field to psMetadataItem?

comment:7 by jhoblitt, 21 years ago

Per our conversation I've added PS_META_NULL to psMetadataFlags in the SDRS.

typedef enum { /< option flags for psMetadata functions

PS_META_DEFAULT = 0, /< default behavior (0x0000) for use

in mode above

PS_META_REPLACE = 0x1000000 /< allow entry to be replaced
PS_META_DUPLICATE_OK = 0x2000000
/< allow duplicate entries
PS_META_NULL = 0x4000000 /< psMetadataItem.data is a NULL

value} psMetadataFlags;

comment:8 by jhoblitt, 21 years ago

Resolution: fixed
Status: assignedclosed

I've added a section about Configuration file 'Null values' to the SDRS.

comment:9 by jhoblitt, 21 years ago

blocked: 317
dependson: 317
Note: See TracTickets for help on using tickets.