Oyranos Color Management System API - Version 0.9.6

a pointer list More...

#include <oyStructList_s.h>

Inheritance diagram for oyStructList_s:
Inheritance graph
Collaboration diagram for oyStructList_s:
Collaboration graph

Public Member Functions

OYAPI oyStructList_s *OYEXPORT oyStructList_New (oyObject_s object)
 allocate a new StructList object
 oyStructList_Copy
 Copy or Reference a StructList object.
OYAPI int OYEXPORT oyStructList_Release (oyStructList_s **structlist)
 release and possibly deallocate a oyStructList_s object
int oyStructList_MoveIn (oyStructList_s *list, oyStruct_s **ptr, int pos, uint32_t flags)
 oyStructList_s pointer add
oyStruct_soyStructList_GetRef (oyStructList_s *list, int pos)
 oyStructList_s referenced pointer access
oyStruct_soyStructList_GetRefType (oyStructList_s *list, int pos, oyOBJECT_e type)
 oyStructList_s pointer access
int oyStructList_ReleaseAt (oyStructList_s *list, int pos)
 oyStructList_s pointer release
int oyStructList_Count (oyStructList_s *list)
 oyStructList_s count
const char * oyStructList_GetText (oyStructList_s *list, oyNAME_e name_type, int intent_spaces, uint32_t flags)
 Build and obtain the lists member names.
const char * oyStructList_GetID (oyStructList_s *list, int intent_spaces, uint32_t flags)
 Eventually build and obtain the lists member names.
int oyStructList_Clear (oyStructList_s *list)
 Release all listed objects.
int oyStructList_CopyFrom (oyStructList_s *list, oyStructList_s *from, oyObject_s object)
 Clean "list" and copy all listed objects from "from" to "list".
int oyStructList_MoveTo (oyStructList_s *s, int pos, int new_pos)
 Move a list element to a new position.
int oyStructList_Sort (oyStructList_s *list, int32_t *rank_list)
 Sort a list according to a rank_list.
int oyStructList_ObserverAdd (oyStructList_s *list, oyStruct_s *observer, oyStruct_s *user_data, oyObserver_Signal_f signalFunc)
 Add a observer to the each list member.
oyStruct_soyStructList_GetType (oyStructList_s *list, int pos, oyOBJECT_e type)
 oyStructList_s pointer access
oyOBJECT_e oyStructList_GetParentObjType (oyStructList_s *list)
oyStructList_soyStructList_Create (oyOBJECT_e parent_type, const char *list_name, oyObject_s object)
 Create a new oyStruct_s list.
int oyStructList_MoveInName (oyStructList_s *texts, char **text, int pos)
 Add a name to a list.
int oyStructList_AddName (oyStructList_s *texts, const char *text, int pos)
 Add a name to a list.
const char * oyStructList_GetName (oyStructList_s *texts, int pos)
 Add a name to a list.
oyHash_soyStructList_GetHash (oyStructList_s *cache_list, uint32_t flags, const char *hash_text)
 Get a hash from a cache.
oyStruct_soyStructList_GetHashStruct (oyStructList_s *cache_list, uint32_t flags, const char *hash_text, oyOBJECT_e type)
 Get a hash from a cache.
Public Member Functions inherited from oyStruct_s
const char * oyStruct_GetTextFromModule (oyStruct_s *obj, oyNAME_e name_type, uint32_t flags)
 get object infos from a module
const char * oyStruct_GetText (oyStruct_s *obj, oyNAME_e name_type, uint32_t flags)
 Get a text dump.
 oyStruct_RegisterStaticMessageFunc
 register a function for verbosity
 oyStruct_GetInfo
 get a additional string from a object
const char * oyStructTypeToText (oyOBJECT_e type)
 Objects type to small string.

Data Fields

const oyOBJECT_e type_
 Type of object.
oyStruct_Copy_f copy
 Copy function.
oyStruct_Release_f release
 Release function.
oyObject_s oy_
 Oyranos internal object.
Data Fields inherited from oyStruct_s
const oyOBJECT_e type_
 Type of object.
oyStruct_Copy_f copy
 Copy function.
oyStruct_Release_f release
 Release function.
oyObject_s oy_
 Oyranos internal object.

Detailed Description

a pointer list

Member Function Documentation

◆ oyStructList_AddName()

int oyStructList_AddName ( oyStructList_s * texts,
const char * text,
int pos )

Add a name to a list.

Function oyStructList_AddName

The text is added to a oyName_s::name member variable.

Version
Oyranos: 0.1.13
Date
2008/10/07
Since
2008/10/07 (Oyranos: 0.1.13)

References oyStructList_MoveIn().

◆ oyStructList_Clear()

int oyStructList_Clear ( oyStructList_s * list)

Release all listed objects.

Function oyStructList_Clear

Version
Oyranos: 0.1.9
Date
2008/11/27
Since
2008/11/27 (Oyranos: 0.1.9)

References oyOBJECT_STRUCT_LIST_S, and oyStructList_ReleaseAt().

Referenced by oyStructList_CopyFrom().

◆ oyStructList_Copy()

oyStructList_Copy

Copy or Reference a StructList object.

The function is for copying and for referencing. The reference is the most often used way, which saves resourcs and time.

Parameters
[in]structlistStructList struct object
objectNULL - means reference, the optional object triggers a real copy

References oyOBJECT_STRUCT_LIST_S, and oyStructList_Copy().

Referenced by oyStructList_Copy().

◆ oyStructList_CopyFrom()

int oyStructList_CopyFrom ( oyStructList_s * list,
oyStructList_s * from,
oyObject_s object )

Clean "list" and copy all listed objects from "from" to "list".

Function oyStructList_CopyFrom

If the list was observed, the new elements are observed by the list through the standard signal forwarding function (oyStructSignalForward_).

Version
Oyranos: 0.1.10
Since
2008/11/27 (Oyranos: 0.1.9)
Date
2009/10/28

References oyStruct_s::copy, oyStruct_s::oy_, oyOBJECT_STRUCT_LIST_S, oyStructList_Clear(), oyStructList_MoveIn(), oyStructList_ObserverAdd(), oyStruct_s::oyStructTypeToText(), oyStruct_s::type_, and type_.

◆ oyStructList_Count()

int oyStructList_Count ( oyStructList_s * list)

oyStructList_s count

Function oyStructList_Count

Since
Oyranos: version 0.1.8
Date
21 november 2007 (API 0.1.8)

References oyOBJECT_STRUCT_LIST_S.

Referenced by oyStructList_GetText(), oyStructList_MoveTo(), oyStructList_ObserverAdd(), and oyStructList_Sort().

◆ oyStructList_Create()

oyStructList_s * oyStructList_Create ( oyOBJECT_e parent_type,
const char * list_name,
oyObject_s object )

Create a new oyStruct_s list.

Function oyStructList_Create

Parameters
parent_typetype of parent object
list_nameoptional list name
objectthe optional object
Returns
a empty list
Version
Oyranos: 0.1.8
Since
2008/11/02 (Oyranos: 0.1.8)
Date
2008/11/02

References oyObject_SetNames(), and oyStructList_New().

◆ oyStructList_GetHash()

oyHash_s * oyStructList_GetHash ( oyStructList_s * cache_list,
uint32_t flags,
const char * hash_text )

Get a hash from a cache.

Function oyStructList_GetHash

Get always a Oyranos cache entry from a cache list.

Parameters
[in]cache_listthe list to search in
[in]flags- 0 - assume text, length is strlen()
  • 1 - assume 16 byte hash instead of text
[in]hash_textthe text to search for in the cache_list
Returns
the cache entry may not have a entry
Version
Oyranos: 0.9.0
Date
2012/10/17
Since
2012/10/17 (Oyranos: 0.9.0)

References oyCacheListGetEntry_().

◆ oyStructList_GetHashStruct()

oyStruct_s * oyStructList_GetHashStruct ( oyStructList_s * cache_list,
uint32_t flags,
const char * hash_text,
oyOBJECT_e type )

Get a hash from a cache.

Function oyStructList_GetHashStruct

Get always a Oyranos cache entry from a cache list.

Parameters
[in]cache_listthe list to search in
[in]flags- 0 - assume text, length is strlen()
  • 1 - assume 16 byte hash instead of text
[in]hash_textthe text to search for in the cache_list
[in]typethre requested object type
Returns
the cache entry may not have a entry
Version
Oyranos: 0.9.0
Date
2012/10/17
Since
2012/10/17 (Oyranos: 0.9.0)

References oyCacheListGetEntry_().

◆ oyStructList_GetID()

const char * oyStructList_GetID ( oyStructList_s * list,
int intent_spaces,
uint32_t flags )

Eventually build and obtain the lists member names.

Function oyStructList_GetID

Version
Oyranos: 0.1.8
Date
2008/11/04
Since
2008/11/04 (Oyranos: 0.1.8)

References oy_, oyNAME_NICK, oyObject_GetName(), and oyStructList_GetText().

◆ oyStructList_GetName()

const char * oyStructList_GetName ( oyStructList_s * texts,
int pos )

Add a name to a list.

Function oyStructList_GetName

The text is added a a oyName_s::name member variable.

Version
Oyranos: 0.3.1
Date
2011/05/18
Since
2011/05/18 (Oyranos: 0.3.1)

References oyNAME_NAME, oyOBJECT_NAME_S, and oyStructList_GetRefType().

◆ oyStructList_GetParentObjType()

oyOBJECT_e oyStructList_GetParentObjType ( oyStructList_s * list)

Function oyStructList_GetParentObjType

References oyOBJECT_STRUCT_LIST_S.

◆ oyStructList_GetRef()

oyStruct_s * oyStructList_GetRef ( oyStructList_s * list,
int pos )

oyStructList_s referenced pointer access

Function oyStructList_GetRef

Since
Oyranos: version 0.1.8
Date
4 december 2007 (API 0.1.8)

References oyObject_Lock(), and oyObject_UnLock().

Referenced by oyStructList_GetRefType(), and oyStructList_MoveTo().

◆ oyStructList_GetRefType()

oyStruct_s * oyStructList_GetRefType ( oyStructList_s * list,
int pos,
oyOBJECT_e type )

oyStructList_s pointer access

Function oyStructList_GetRefType

Since
Oyranos: version 0.1.8
Date
1 january 2008 (API 0.1.8)

References oyStruct_s::oy_, oyStructList_GetRef(), oyStruct_s::release, and oyStruct_s::type_.

Referenced by oyStructList_GetName().

◆ oyStructList_GetText()

const char * oyStructList_GetText ( oyStructList_s * list,
oyNAME_e name_type,
int intent_spaces,
uint32_t flags )

Build and obtain the lists member names.

Function oyStructList_GetText

Version
Oyranos: 0.1.8
Date
2008/11/04
Since
2008/11/04 (Oyranos: 0.1.8)

References oyStruct_s::oy_, oyObject_GetName(), oyObject_SetName(), and oyStructList_Count().

Referenced by oyStructList_GetID().

◆ oyStructList_GetType()

oyStruct_s * oyStructList_GetType ( oyStructList_s * list,
int pos,
oyOBJECT_e type )

oyStructList_s pointer access

Function oyStructList_GetType

non thread save; better dont use

Since
Oyranos: version 0.1.8
Date
1 january 2008 (API 0.1.8)

References oyStruct_s::type_.

◆ oyStructList_MoveIn()

int oyStructList_MoveIn ( oyStructList_s * list,
oyStruct_s ** ptr,
int pos,
uint32_t flags )

oyStructList_s pointer add

Function oyStructList_MoveIn

If the list was observed, the new elements are not automatically observed. The caller can select OY_OBSERVE_AS_WELL in the flags argument if he wishes to observe a newly added element as well. The attached observation function will be oyStructSignalForward_.

Parameters
[in]listthe list
[in]ptrthe handle this function takes ownership of
[in]posthe prefered position in the list. This option has affect of the order in list.
[in]flagsOY_OBSERVE_AS_WELL
Version
Oyranos: 0.1.10
Since
2007/11/30 (Oyranos: 0.1.8)
Date
2009/10/28

References oyObject_Lock(), oyOBJECT_STRUCT_LIST_S, oyObject_UnLock(), and oyStruct_s::type_.

Referenced by oyStructList_AddName(), oyStructList_CopyFrom(), oyStructList_MoveInName(), and oyStructList_MoveTo().

◆ oyStructList_MoveInName()

int oyStructList_MoveInName ( oyStructList_s * texts,
char ** text,
int pos )

Add a name to a list.

Function oyStructList_MoveInName

The text is added to a oyName_s::name member variable and owned by the list.

Version
Oyranos: 0.1.13
Date
2008/10/07
Since
2008/10/07 (Oyranos: 0.1.13)

References oyStructList_MoveIn().

◆ oyStructList_MoveTo()

int oyStructList_MoveTo ( oyStructList_s * s,
int pos,
int new_pos )

Move a list element to a new position.

Function oyStructList_MoveTo

real used?

Version
Oyranos: 0.1.10
Date
2009/05/22
Since
2009/05/22 (Oyranos: 0.1.10)

References oyOBJECT_STRUCT_LIST_S, oyStructList_Count(), oyStructList_GetRef(), oyStructList_MoveIn(), and oyStructList_ReleaseAt().

◆ oyStructList_New()

OYAPI oyStructList_s *OYEXPORT oyStructList_New ( oyObject_s object)

allocate a new StructList object

Function oyStructList_New

References oyOBJECT_OBJECT_S.

Referenced by oyStructList_Create().

◆ oyStructList_ObserverAdd()

int oyStructList_ObserverAdd ( oyStructList_s * list,
oyStruct_s * observer,
oyStruct_s * user_data,
oyObserver_Signal_f signalFunc )

Add a observer to the each list member.

Function oyStructList_ObserverAdd

Members are further observed by the list object.

Version
Oyranos: 0.1.10
Date
2009/10/28
Since
2009/10/28 (Oyranos: 0.1.10)

References oyOBJECT_STRUCT_LIST_S, and oyStructList_Count().

Referenced by oyStructList_CopyFrom().

◆ oyStructList_Release()

OYAPI int OYEXPORT oyStructList_Release ( oyStructList_s ** structlist)

release and possibly deallocate a oyStructList_s object

Function oyStructList_Release

Parameters
[in,out]structlistStructList struct object

References oyOBJECT_STRUCT_LIST_S.

◆ oyStructList_ReleaseAt()

int oyStructList_ReleaseAt ( oyStructList_s * list,
int pos )

oyStructList_s pointer release

Function oyStructList_ReleaseAt

release and shrink

Version
Oyranos: 0.1.8
Date
2007/11/21
Since
2007/11/21 (Oyranos: 0.1.8)

References oyObject_Lock(), oyOBJECT_STRUCT_LIST_S, and oyObject_UnLock().

Referenced by oyStructList_Clear(), and oyStructList_MoveTo().

◆ oyStructList_Sort()

int oyStructList_Sort ( oyStructList_s * list,
int32_t * rank_list )

Sort a list according to a rank_list.

Function oyStructList_Sort

Version
Oyranos: 0.1.10
Date
2009/05/23
Since
2009/05/23 (Oyranos: 0.1.10)

References oyObject_Lock(), oyOBJECT_STRUCT_LIST_S, oyObject_UnLock(), and oyStructList_Count().

Field Documentation

◆ copy

oyStruct_Copy_f oyStructList_s::copy

Copy function.

◆ oy_

oyObject_s oyStructList_s::oy_

Oyranos internal object.

Features name and hash. Do not change during object life time.

Referenced by oyStructList_GetID().

◆ release

oyStruct_Release_f oyStructList_s::release

Release function.

◆ type_

const oyOBJECT_e oyStructList_s::type_

Type of object.

The struct type tells Oyranos how to interprete hidden fields.

Referenced by oyStructList_CopyFrom().