Harlequin RIP SDK

This file provides definitions for the core RIP Data Resource API. More...

#include "std.h"
#include "mem.h"
#include "rhhashmap.h"
#include "threadapi.h"
#include "rdrapi.h"
#include "eventapi.h"

Data Structures

struct  sw_rdr
 Our internal representation of an RDR registration. More...
 
struct  rdr_key_t
 The key structure used for the RDR hash map. More...
 
struct  rdr_lookup_t
 
struct  sw_rdr_iterator
 Our private iterator structure. More...
 

Typedefs

typedef struct sw_rdr sw_rdr
 Our internal representation of an RDR registration. More...
 
typedef struct rdr_key_t rdr_key_t
 The key structure used for the RDR hash map.
 
typedef struct rdr_lookup_t rdr_lookup_t
 

Enumerations

enum  rdr_iterator_flags {
  CHECK_CLASS = 1 , CHECK_TYPE = 2 , CHECK_ID = 4 , CHECK_PRIORITY = 8 ,
  ITERATOR_DEAD = 16 , ITERATOR_BUSY = 32 , ITERATE_PRIORITIES = 64 , CHECK_ANY = 0 ,
  CHECK_ALL = CHECK_CLASS|CHECK_TYPE|CHECK_ID , CHECK_INSERT = CHECK_ALL|CHECK_PRIORITY , CHECK_DUPLICATES = CHECK_ALL|ITERATE_PRIORITIES
}
 Iterator flags. More...
 

Functions

rdr_lookup_tlookup_acquire_classtype (sw_rdr_class Class, sw_rdr_type Type)
 
void lookup_release (rdr_lookup_t **plookup)
 
int rdr_hashmap_create (void)
 
void rdr_hashmap_destroy (void)
 
void link_iterator (sw_rdr_iterator *iterator, sw_rdr_iterator **list)
 Link an iterator into a list.
 
void unlink_iterator (sw_rdr_iterator *iterator)
 unlink an iterator from either list
 
void unlock_previous_rdr (sw_rdr_iterator *iterator)
 Unlock a previously locked RDR.
 

Detailed Description

This file provides definitions for the core RIP Data Resource API.

Copyright (C) 2023 Global Graphics Software Ltd. All rights reserved. This source code contains the confidential and trade secret information of Global Graphics Software Ltd. It may not be used, copied or distributed for any reason except as set forth in the applicable Global Graphics license agreement.

Typedef Documentation

◆ rdr_lookup_t

typedef struct rdr_lookup_t rdr_lookup_t

The value structure stored in the hash map. This is the head of a list of RDRs sorted by Id and Priority.

◆ sw_rdr

typedef struct sw_rdr sw_rdr

Our internal representation of an RDR registration.

These are never exposed to Providers or Consumers.

Currently this is a linked list stored in ascending order of Class, Type, Id and descending Priority, but this may be restructured if the RDR system gains significant use.

Note that when multithreading, an RDR could conceivably be deregistered by another thread after it has been found but before it has been accessed, so all such usage MUST be protected by mutex.

Enumeration Type Documentation

◆ rdr_iterator_flags

Iterator flags.

Enumerator
CHECK_CLASS 

Class must match

CHECK_TYPE 

Type must match

CHECK_ID 

Id must match

CHECK_PRIORITY 

Priority must match - internal use only

ITERATOR_DEAD 

Iterator has been killed by a deregistration

ITERATOR_BUSY 

Iterator is in use

ITERATE_PRIORITIES 

Lower priorities also returned - internal use

Function Documentation

◆ lookup_acquire_classtype()

rdr_lookup_t* lookup_acquire_classtype ( sw_rdr_class  Class,
sw_rdr_type  Type 
)

Lookup an existing RDR list using Class,Type and acquire a reference count.

Parameters
[in]ClassThe class of the lookup to perform.
[in]TypeThe type of the lookup to perform.
Returns
If the Class,Type exists, an RDR lookup structure, with an increased reference count. This reference must be released by the caller using lookup_release(). If the Class,Type does not exist, NULL is returned.

This function must be called with the RDR mutex locked.

◆ lookup_release()

void lookup_release ( rdr_lookup_t **  plookup)

Release a reference to an RDR lookup, freeing it and removing from the map if necessary. This must be called with the mutex locked.

◆ rdr_hashmap_create()

int rdr_hashmap_create ( void  )

Glue function to create the map of RDRs.

◆ rdr_hashmap_destroy()

void rdr_hashmap_destroy ( void  )

Glue function to destroy the map of RDRs.