summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.h
blob: 9bf902d98d856c0e1c01c19249b95002d6f2ccbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/* -*- C++ -*- */

// ============================================================================
// $Id$ 
//  
//
// = FILENAME 
//    Video_Repository.h
// 
// = DESCRIPTION 
//    As a trading service dynamic property, creates a sequence of
//    structures, each structure describing a movie in the video
//    repository. 
// 
// = AUTHORS
//    Seth Widoff <sbw1@cs.wustl.edu>
//
// ============================================================================

#if (! defined TAO_VIDEO_REPOSITORY_H)
#define TAO_VIDEO_REPOSITORY_H

#include "orbsvcs/Trader/Dynamic_Property.h" 

#include "ace/OS.h"
#include "Video_RepositoryC.h"
#include "Property_Exporter.h"

class TAO_Video_Repository :
  public TAO_DP_Evaluation_Handler,
  public TAO_Exportable
// = DESCRIPTION
//   When evalDP is invoked by the Dynamic Property Dispatcher, the
//   TAO_Video_Repository parses the database file and creates a Movie 
//   Sequence, each structure of which describes a movie in the
//   database. The evalDP then crams the sequence into a dynamically
//   allocated Any, which it returns to the dispatcher.
//
//   The format of the database file is the following:
//
//   <file name>%<Movie Name>%<URL for description>
{
public:

  static const char* MOVIE_NAMES;
  static const char* MOVIE_INFO;
  
  TAO_Video_Repository (const char* filename);
  // TAO_Video_Repository requires the pathname of the video
  // repository database.

  ~TAO_Video_Repository (void);
  
  virtual CORBA::Any* evalDP (const CORBA::Any& extra_info,
			      CORBA::TypeCode_ptr returned_type,
			      CORBA::Environment& _env)
    TAO_THROW_SPEC ((CosTradingDynamic::DPEvalFailure));

  virtual void export_dynamic_properties (TAO_Property_Exporter& prop_exporter,
					  TAO_DP_Dispatcher& dp_dispatcher) const;
  
  virtual int define_properties
    (CosTradingRepos::ServiceTypeRepository::PropStructSeq& prop_seq,
     CORBA::ULong offet = 0) const;

private:

  void parse_file (const char* database, int num_lines);

  static void obtain_movie_info (const char* file_name,
				 TAO_VR::Movie& movie) {}
  // Extract the techincal information from the actual MPEG file.
  
  TAO_Video_Repository (void) {}
  TAO_Video_Repository& operator= (const TAO_Video_Repository& rep)
    { return *this; }
  // TAO_Video_Repository requires the path of the video repository
  // database.

  const char* filename_;
  char** movie_names_;
  TAO_VR::Movie* movie_info_;
  int num_movies_;
  time_t lastchanged_;
};

#endif /* TAO_VIDEO_REPOSITORY_H */