//
//  CHPublisher.h
//  Chocolat
//
//  Created by Pieter Omvlee on 6/27/08.
//  Copyright 2008 Bohemian Coding. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@protocol CHSubscriber
- (void)publisher:(id)aPublisher publishedObject:(id)object;
@end

@interface CHPublisher : NSObject <NSCoding, NSCopying> {
  NSMutableArray *subscribers;
}
//publishing an update
- (void)publish:(id)anObject;

//adding subscribers

- (void)addSubscriber:(id<CHSubscriber>)aSubscriber;
- (void)removeSubscriber:(id<CHSubscriber>)aSubscriber;
- (void)removeAllSubscribers;

@property (retain) NSMutableArray *subscribers;

@end