design_pattern_for_c  V 1.00
publish_content.c File Reference

Implement of Flyweight design petten library API, related to PublishContent class. More...

#include "publish_content.h"
#include <stdlib.h>
#include <pthread.h>
#include "dp_util.h"
Include dependency graph for publish_content.c:

Go to the source code of this file.

Data Structures

struct  subscriber_account_t
 SubscriberAccount class member definition, to get by publisher_subscribe. More...
 
struct  publish_content_t
 

Functions

PublishContent publish_content_new (void)
 
SubscriberAccount publish_content_subscribe (PublishContent this, int publish_type, void(*notify)(int publish_type, void *detail, void *ctx), void *ctx)
 
void publish_content_subscribe_oneshot (PublishContent this, int publish_type, void(*notify)(int publish_type, void *detail, void *ctx), void *ctx)
 
void publish_content_unsubscribe (PublishContent this, SubscriberAccount account)
 
void publish_content_publish (PublishContent this, int publish_type, void *detail)
 
void publish_content_free (PublishContent this)
 

PublishContent private method

#define PUBLISH_CONTENT_LOCK(content)   DPUTIL_LOCK(&(content->lock))
 
#define PUBLISH_CONTENT_UNLOCK   DPUTIL_UNLOCK
 
static void publish_content_push_subscriber (PublishContent this, SubscriberAccount account)
 push subscriber More...
 
static void publish_content_pull_subscriber (PublishContent this, SubscriberAccount account)
 pull subscriber More...
 
static SubscriberAccount publish_content_pop_subscriber (PublishContent this)
 pop subscriber More...
 

Detailed Description

Implement of Flyweight design petten library API, related to PublishContent class.

Definition in file publish_content.c.

Macro Definition Documentation

◆ PUBLISH_CONTENT_LOCK

#define PUBLISH_CONTENT_LOCK (   content)    DPUTIL_LOCK(&(content->lock))

Definition at line 42 of file publish_content.c.

◆ PUBLISH_CONTENT_UNLOCK

#define PUBLISH_CONTENT_UNLOCK   DPUTIL_UNLOCK

Definition at line 43 of file publish_content.c.

Function Documentation

◆ publish_content_free()

void publish_content_free ( PublishContent  this)

Definition at line 116 of file publish_content.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ publish_content_new()

PublishContent publish_content_new ( void  )

Definition at line 49 of file publish_content.c.

Here is the caller graph for this function:

◆ publish_content_pop_subscriber()

static SubscriberAccount publish_content_pop_subscriber ( PublishContent  this)
inlinestatic

pop subscriber

Definition at line 37 of file publish_content.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ publish_content_publish()

void publish_content_publish ( PublishContent  this,
int  publish_type,
void *  detail 
)

Definition at line 91 of file publish_content.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ publish_content_pull_subscriber()

static void publish_content_pull_subscriber ( PublishContent  this,
SubscriberAccount  account 
)
inlinestatic

pull subscriber

Definition at line 32 of file publish_content.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ publish_content_push_subscriber()

static void publish_content_push_subscriber ( PublishContent  this,
SubscriberAccount  account 
)
inlinestatic

push subscriber

Definition at line 28 of file publish_content.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ publish_content_subscribe()

SubscriberAccount publish_content_subscribe ( PublishContent  this,
int  publish_type,
void(*)(int publish_type, void *detail, void *ctx)  notify,
void *  ctx 
)

Definition at line 55 of file publish_content.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ publish_content_subscribe_oneshot()

void publish_content_subscribe_oneshot ( PublishContent  this,
int  publish_type,
void(*)(int publish_type, void *detail, void *ctx)  notify,
void *  ctx 
)

Definition at line 70 of file publish_content.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ publish_content_unsubscribe()

void publish_content_unsubscribe ( PublishContent  this,
SubscriberAccount  account 
)

Definition at line 84 of file publish_content.c.

Here is the call graph for this function:
Here is the caller graph for this function: