00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef AGAPI_h
00010 #define AGAPI_h
00011
00012 #include <string>
00013 #include <list>
00014 #include <set>
00015 #include <map>
00016 #include "AGTypes.h"
00017
00018 using namespace std;
00019
00020
00021
00022 #ifdef _MSC_VER
00023 #define DllExport __declspec( dllexport )
00024 #else
00025 #define DllExport
00026 #endif
00027
00029 DllExport AGSetId CreateAGSet(AGSetId id);
00030 DllExport bool ExistsAGSet(AGSetId id);
00031 DllExport void DeleteAGSet(AGSetId id);
00032
00033
00034 DllExport AGId CreateAG(Id id, TimelineId timelineId);
00035 DllExport bool ExistsAG(AGId agId);
00036 DllExport void DeleteAG(AGId agId);
00037 DllExport AGIds GetAGIds(AGSetId agSetId);
00038
00039
00041
00042 DllExport TimelineId CreateTimeline(Id id);
00043 DllExport bool ExistsTimeline(TimelineId timelineId);
00044 DllExport void DeleteTimeline(TimelineId timelineId);
00045
00046
00047 DllExport SignalId CreateSignal(Id id,URI uri,MimeClass mimeClass,MimeType mimeType,
00048 Encoding encoding,Unit unit,Track track);
00049 DllExport bool ExistsSignal(SignalId signalId);
00050 DllExport void DeleteSignal(SignalId signalId);
00051 DllExport SignalIds GetSignals(TimelineId timelineId);
00052
00053 DllExport MimeClass GetSignalMimeClass(SignalId signalId);
00054 DllExport MimeType GetSignalMimeType(SignalId signalId);
00055 DllExport Encoding GetSignalEncoding(SignalId signalId);
00056 DllExport string GetSignalXlinkType(SignalId signalId);
00057 DllExport string GetSignalXlinkHref(SignalId signalId);
00058 DllExport string GetSignalUnit(SignalId signalId);
00059 DllExport Track GetSignalTrack(SignalId signalId);
00060
00062
00063
00064 DllExport AnnotationId CreateAnnotation(Id id,AnchorId anchorId1,AnchorId anchorId2,AnnotationType annotationType);
00065 DllExport bool ExistsAnnotation(AnnotationId annotationId);
00066 DllExport void DeleteAnnotation(AnnotationId annotationId);
00067 DllExport AnnotationId CopyAnnotation(AnnotationId annotationId);
00068 DllExport AnnotationIds SplitAnnotation(AnnotationId annotationId);
00069 DllExport AnnotationIds NSplitAnnotation(AnnotationId annotationId,short N);
00070 DllExport AnnotationType GetAnnotationType(AnnotationId annotationId);
00071 DllExport String GetAnnotationInfo(AnnotationId annotationId);
00072 DllExport AnchorId GetStartAnchor(AnnotationId annotationId);
00073 DllExport AnchorId GetEndAnchor(AnnotationId annotationId);
00074 DllExport void SetStartAnchor(AnnotationId annotationId,AnchorId anchorId);
00075 DllExport void SetEndAnchor(AnnotationId annotationId,AnchorId anchorId);
00076
00077 DllExport Offset GetStartOffset(AnnotationId annotationId);
00078 DllExport Offset GetEndOffset(AnnotationId annotationId);
00079 DllExport void SetStartOffset(AnnotationId annotationId,Offset offset);
00080 DllExport void SetEndOffset(AnnotationId annotationId,Offset offset);
00081
00082
00083 DllExport set<AnnotationType> GetAnnotationTypes(Id id);
00084 DllExport set<FeatureName> GetAnnotationFeatureNames(Id id);
00085
00086
00087 DllExport AnnotationRef GetRef(Id id);
00088
00089
00091
00092
00093
00094
00095 DllExport void SetFeature(Id id,FeatureName featureName,FeatureValue featureValue);
00096 DllExport bool ExistsFeature(Id id, FeatureName featureName);
00097 DllExport void DeleteFeature(Id id, FeatureName featureName);
00098 DllExport string GetFeature(Id id, FeatureName featureName);
00099 DllExport void UnsetFeature(Id id,FeatureName featureName);
00100 DllExport FeatureNames GetFeatureNames(Id id);
00101 DllExport void SetFeatures(Id id,Features features);
00102 DllExport Features GetFeatures(Id id);
00103 DllExport void UnsetFeatures(Id id);
00104
00105
00107
00108
00109
00110
00112
00113
00114 DllExport AnchorId CreateAnchor(Id id,Offset offset,Unit unit,SignalIds signalIds);
00115 DllExport AnchorId CreateAnchor(Id id,SignalIds signalIds="");
00116 DllExport bool ExistsAnchor(AnchorId anchorId);
00117 DllExport void DeleteAnchor(AnchorId anchorId);
00118 DllExport void SetAnchorOffset(AnchorId anchorId,Offset offset);
00119 DllExport Offset GetAnchorOffset(AnchorId anchorId);
00120 DllExport void SetOffsetUnit(AnchorId anchorId,Unit unit);
00121 DllExport Unit GetOffsetUnit(AnchorId anchorId);
00122 DllExport void SetAnchorSignalIds(AnchorId anchorId,SignalIds signalIds);
00123 DllExport SignalIds GetAnchorSignalIds(AnchorId anchorId);
00124 DllExport bool GetAnchored(AnchorId anchorId);
00125 DllExport void UnsetAnchorOffset(AnchorId anchorId);
00126 DllExport AnchorId SplitAnchor(AnchorId anchorId);
00127
00128 DllExport AnnotationIds GetIncomingAnnotationSet(AnchorId anchorId);
00129 DllExport AnnotationIds GetOutgoingAnnotationSet(AnchorId anchorId);
00130 DllExport AnnotationIds GetIncomingAnnotationSetByType(AnchorId anchorId, AnnotationType type);
00131 DllExport AnnotationIds GetOutgoingAnnotationSetByType(AnchorId anchorId, AnnotationType type);
00132
00134
00135 DllExport AnchorIds GetAnchorSet(AGId agId);
00136 DllExport AnchorIds GetAnchorSetByOffset(AGId agId,Offset offset, double epsilon=0.0);
00137 DllExport AnchorIds GetAnchorSetNearestOffset(AGId agId,Offset offset);
00138 DllExport AnnotationIds GetAnnotationSetByFeature(AGId agId,FeatureName featureName, FeatureValue featureValue);
00147 DllExport AnnotationIds GetAnnotationSetByOffset(AGId agId,Offset offset);
00148 DllExport AnnotationIds GetAnnotationSetByType(AGId agId,AnnotationType annotationType);
00149 DllExport AnnotationIds GetAnnotationSeqByOffset(AGId agId, Offset begin=0.0, Offset end=0.0);
00150 DllExport AnnotationId GetAnnotationByOffset(AGId agId,Offset offset);
00151
00153
00154
00155 DllExport AGSetId GetAGSetId(Id id="");
00156
00157
00158 DllExport AGId GetAGId(Id id);
00159
00160
00161 DllExport TimelineId GetTimelineId(Id id);
00162
00163
00164 DllExport string toXML(Id id);
00165
00166
00167
00168 DllExport bool LoadFromDB(string connStr, AGSetId agsetId);
00169
00170
00171
00172 DllExport bool StoreToDB(string connStr, AGSetId agSetId);
00173
00174
00175 DllExport list<string> StoreSQLs(AGSetId agSetId);
00176
00177
00178 DllExport bool SPrecedes(const AnnotationId& x, const AnnotationId& y);
00179
00180
00181 DllExport AGIds
00182 Load(const string& format,
00183 const string& annotationFile,
00184 const string& id = "",
00185 map<string,string>* signalInfo = NULL,
00186 map<string,string>* options = NULL);
00187
00188 DllExport void
00189 Store(const string& format,
00190 const string& filename,
00191 const string& agIds = "",
00192 map<string,string>* options = NULL);
00193
00194
00195
00196 DllExport bool
00197 CheckAnchorOffsetTotal(Id agId,
00198 AnnotationType type);
00199 DllExport bool
00200 CheckAnchorOffsetBounded(Id agId,
00201 AnnotationType type);
00202
00203 DllExport bool
00204 CheckFeatureExists(Id agId, AnnotationType type, FeatureName featureName);
00205
00206 DllExport bool
00207 CheckFeatureIsAnnotationId(Id agId, AnnotationType type, FeatureName featureName);
00208
00209 DllExport bool
00210 CheckLinear(Id agId, AnnotationType type);
00211
00212 DllExport bool
00213 CheckConnected(Id agId, AnnotationType type);
00214
00215 DllExport bool
00216 CheckCoextensive(Id agId, AnnotationType type1, AnnotationType type2);
00217
00218 DllExport bool
00219 CheckSpan(Id agId, AnnotationType spanType, AnnotationType spannedType);
00220
00221 #endif