1 #if !defined( DSBSPECFRAME_INCLUDED ) /* Include this file only once */
2 #define DSBSPECFRAME_INCLUDED
3 /*
4 *+
5 *  Name:
6 *     dsbspecframe.h
7 
8 *  Type:
9 *     C include file.
10 
11 *  Purpose:
12 *     Define the interface to the DSBSpecFrame class.
13 
14 *  Invocation:
15 *     #include "dsbspecframe.h"
16 
17 *  Description:
18 *     This include file defines the interface to the DSBSpecFrame class and
19 *     provides the type definitions, function prototypes and macros,
20 *     etc.  needed to use this class.
21 
22 *  Inheritance:
23 *     The DSBSpecFrame class inherits from the SpecFrame class.
24 
25 *  Copyright:
26 *     Copyright (C) 1997-2006 Council for the Central Laboratory of the
27 *     Research Councils
28 
29 *  Licence:
30 *     This program is free software: you can redistribute it and/or
31 *     modify it under the terms of the GNU Lesser General Public
32 *     License as published by the Free Software Foundation, either
33 *     version 3 of the License, or (at your option) any later
34 *     version.
35 *
36 *     This program is distributed in the hope that it will be useful,
37 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
38 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
39 *     GNU Lesser General Public License for more details.
40 *
41 *     You should have received a copy of the GNU Lesser General
42 *     License along with this program.  If not, see
43 *     <http://www.gnu.org/licenses/>.
44 
45 *  Authors:
46 *     DSB: D.S. Berry (Starlink)
47 
48 *  History:
49 *     5-AUG-2004 (DSB):
50 *        Original version.
51 *     27-OCT-2006 (DSB):
52 *        Added AlignSideBand.
53 *-
54 */
55 
56 /* Include files. */
57 /* ============== */
58 /* Interface definitions. */
59 /* ---------------------- */
60 #include "specframe.h"           /* Spectral coord systems (parent class) */
61 
62 /* C header files. */
63 /* --------------- */
64 
65 /* Macros */
66 /* ====== */
67 
68 /* Define a dummy __attribute__ macro for use on non-GNU compilers. */
69 #ifndef __GNUC__
70 #  define  __attribute__(x)  /*NOTHING*/
71 #endif
72 
73 /* Type Definitions. */
74 /* ================= */
75 /* DSBSpecFrame structure. */
76 /* ------------------ */
77 /* This structure contains all information that is unique to each object in
78    the class (e.g. its instance variables). */
79 typedef struct AstDSBSpecFrame {
80 
81 /* Attributes inherited from the parent class. */
82    AstSpecFrame specframe;      /* Parent class structure */
83 
84 /* Attributes specific to objects in this class. */
85    double dsbcentre;            /* Centre frequency */
86    double ifr;                  /* Intermediate frequency */
87    int sideband;                /* Current sideband */
88    int alignsideband;           /* Aligns sidebands? */
89 
90 } AstDSBSpecFrame;
91 
92 /* Virtual function table. */
93 /* ----------------------- */
94 /* This table contains all information that is the same for all
95    objects in the class (e.g. pointers to its virtual functions). */
96 #if defined(astCLASS)            /* Protected */
97 typedef struct AstDSBSpecFrameVtab {
98 
99 /* Properties (e.g. methods) inherited from the parent class. */
100    AstSpecFrameVtab specframe_vtab;  /* Parent class virtual function table */
101 
102 /* A Unique identifier to determine class membership. */
103    AstClassIdentifier id;
104 
105 /* Properties (e.g. methods) specific to this class. */
106    double (* GetDSBCentre)( AstDSBSpecFrame *, int * );
107    int (* TestDSBCentre)( AstDSBSpecFrame *, int * );
108    void (* ClearDSBCentre)( AstDSBSpecFrame *, int * );
109    void (* SetDSBCentre)( AstDSBSpecFrame *, double, int * );
110 
111    double (* GetIF)( AstDSBSpecFrame *, int * );
112    int (* TestIF)( AstDSBSpecFrame *, int * );
113    void (* ClearIF)( AstDSBSpecFrame *, int * );
114    void (* SetIF)( AstDSBSpecFrame *, double, int * );
115 
116    int (* GetSideBand)( AstDSBSpecFrame *, int * );
117    int (* TestSideBand)( AstDSBSpecFrame *, int * );
118    void (* ClearSideBand)( AstDSBSpecFrame *, int * );
119    void (* SetSideBand)( AstDSBSpecFrame *, int, int * );
120 
121    int (* GetAlignSideBand)( AstDSBSpecFrame *, int * );
122    int (* TestAlignSideBand)( AstDSBSpecFrame *, int * );
123    void (* ClearAlignSideBand)( AstDSBSpecFrame *, int * );
124    void (* SetAlignSideBand)( AstDSBSpecFrame *, int, int * );
125 
126    double (* GetImagFreq)( AstDSBSpecFrame *, int * );
127 
128 } AstDSBSpecFrameVtab;
129 
130 #if defined(THREAD_SAFE)
131 
132 /* Define a structure holding all data items that are global within this
133    class. */
134 typedef struct AstDSBSpecFrameGlobals {
135    AstDSBSpecFrameVtab Class_Vtab;
136    int Class_Init;
137    char GetAttrib_Buff[ 101 ];
138    char GetLabel_Buff[ 101 ];
139 } AstDSBSpecFrameGlobals;
140 
141 #endif
142 
143 #endif
144 
145 /* Function prototypes. */
146 /* ==================== */
147 /* Prototypes for standard class functions. */
148 /* ---------------------------------------- */
149 astPROTO_CHECK(DSBSpecFrame)          /* Check class membership */
150 astPROTO_ISA(DSBSpecFrame)            /* Test class membership */
151 
152 /* Constructor. */
153 #if defined(astCLASS)            /* Protected. */
154 AstDSBSpecFrame *astDSBSpecFrame_( const char *, int *, ...);
155 #else
156 AstDSBSpecFrame *astDSBSpecFrameId_( const char *, ... )__attribute__((format(printf,1,2)));
157 #endif
158 
159 #if defined(astCLASS)            /* Protected */
160 
161 /* Initialiser. */
162 AstDSBSpecFrame *astInitDSBSpecFrame_( void *, size_t, int, AstDSBSpecFrameVtab *,
163                                        const char *, int * );
164 
165 /* Vtab initialiser. */
166 void astInitDSBSpecFrameVtab_( AstDSBSpecFrameVtab *, const char *, int * );
167 
168 /* Loader. */
169 AstDSBSpecFrame *astLoadDSBSpecFrame_( void *, size_t, AstDSBSpecFrameVtab *,
170                                        const char *, AstChannel *, int * );
171 
172 /* Thread-safe initialiser for all global data used by this module. */
173 #if defined(THREAD_SAFE)
174 void astInitDSBSpecFrameGlobals_( AstDSBSpecFrameGlobals * );
175 #endif
176 
177 #endif
178 
179 /* Prototypes for member functions. */
180 /* -------------------------------- */
181 # if defined(astCLASS)           /* Protected */
182    double astGetDSBCentre_( AstDSBSpecFrame *, int * );
183    int astTestDSBCentre_( AstDSBSpecFrame *, int * );
184    void astClearDSBCentre_( AstDSBSpecFrame *, int * );
185    void astSetDSBCentre_( AstDSBSpecFrame *, double, int * );
186 
187    double astGetIF_( AstDSBSpecFrame *, int * );
188    int astTestIF_( AstDSBSpecFrame *, int * );
189    void astClearIF_( AstDSBSpecFrame *, int * );
190    void astSetIF_( AstDSBSpecFrame *, double, int * );
191 
192    int astGetSideBand_( AstDSBSpecFrame *, int * );
193    int astTestSideBand_( AstDSBSpecFrame *, int * );
194    void astClearSideBand_( AstDSBSpecFrame *, int * );
195    void astSetSideBand_( AstDSBSpecFrame *, int, int * );
196 
197    int astGetAlignSideBand_( AstDSBSpecFrame *, int * );
198    int astTestAlignSideBand_( AstDSBSpecFrame *, int * );
199    void astClearAlignSideBand_( AstDSBSpecFrame *, int * );
200    void astSetAlignSideBand_( AstDSBSpecFrame *, int, int * );
201 
202    double astGetImagFreq_( AstDSBSpecFrame *, int * );
203 #endif
204 
205 /* Function interfaces. */
206 /* ==================== */
207 /* These macros are wrap-ups for the functions defined by this class
208    to make them easier to invoke (e.g. to avoid type mis-matches when
209    passing pointers to objects from derived classes). */
210 
211 /* Interfaces to standard class functions. */
212 /* --------------------------------------- */
213 /* Some of these functions provide validation, so we cannot use them
214    to validate their own arguments. We must use a cast when passing
215    object pointers (so that they can accept objects from derived
216    classes). */
217 
218 /* Check class membership. */
219 #define astCheckDSBSpecFrame(this) astINVOKE_CHECK(DSBSpecFrame,this,0)
220 #define astVerifyDSBSpecFrame(this) astINVOKE_CHECK(DSBSpecFrame,this,1)
221 
222 /* Test class membership. */
223 #define astIsADSBSpecFrame(this) astINVOKE_ISA(DSBSpecFrame,this)
224 
225 /* Constructor. */
226 #if defined(astCLASS)            /* Protected. */
227 #define astDSBSpecFrame astINVOKE(F,astDSBSpecFrame_)
228 #else
229 #define astDSBSpecFrame astINVOKE(F,astDSBSpecFrameId_)
230 #endif
231 
232 #if defined(astCLASS)            /* Protected */
233 
234 /* Initialiser. */
235 #define \
236 astInitDSBSpecFrame(mem,size,init,vtab,name) \
237 astINVOKE(O,astInitDSBSpecFrame_(mem,size,init,vtab,name,STATUS_PTR))
238 
239 /* Vtab Initialiser. */
240 #define astInitDSBSpecFrameVtab(vtab,name) astINVOKE(V,astInitDSBSpecFrameVtab_(vtab,name,STATUS_PTR))
241 /* Loader. */
242 #define astLoadDSBSpecFrame(mem,size,vtab,name,channel) \
243 astINVOKE(O,astLoadDSBSpecFrame_(mem,size,vtab,name,astCheckChannel(channel),STATUS_PTR))
244 #endif
245 
246 /* Interfaces to public member functions. */
247 /* -------------------------------------- */
248 /* Here we make use of astCheckDSBSpecFrame to validate DSBSpecFrame pointers
249    before use.  This provides a contextual error report if a pointer
250    to the wrong sort of Object is supplied. */
251 
252 #if defined(astCLASS)            /* Protected */
253 
254 #define astGetDSBCentre(this) \
255 astINVOKE(V,astGetDSBCentre_(astCheckDSBSpecFrame(this),STATUS_PTR))
256 #define astTestDSBCentre(this) \
257 astINVOKE(V,astTestDSBCentre_(astCheckDSBSpecFrame(this),STATUS_PTR))
258 #define astClearDSBCentre(this) \
259 astINVOKE(V,astClearDSBCentre_(astCheckDSBSpecFrame(this),STATUS_PTR))
260 #define astSetDSBCentre(this,val) \
261 astINVOKE(V,astSetDSBCentre_(astCheckDSBSpecFrame(this),val,STATUS_PTR))
262 
263 #define astGetIF(this) \
264 astINVOKE(V,astGetIF_(astCheckDSBSpecFrame(this),STATUS_PTR))
265 #define astTestIF(this) \
266 astINVOKE(V,astTestIF_(astCheckDSBSpecFrame(this),STATUS_PTR))
267 #define astClearIF(this) \
268 astINVOKE(V,astClearIF_(astCheckDSBSpecFrame(this),STATUS_PTR))
269 #define astSetIF(this,val) \
270 astINVOKE(V,astSetIF_(astCheckDSBSpecFrame(this),val,STATUS_PTR))
271 
272 #define astGetSideBand(this) \
273 astINVOKE(V,astGetSideBand_(astCheckDSBSpecFrame(this),STATUS_PTR))
274 #define astTestSideBand(this) \
275 astINVOKE(V,astTestSideBand_(astCheckDSBSpecFrame(this),STATUS_PTR))
276 #define astClearSideBand(this) \
277 astINVOKE(V,astClearSideBand_(astCheckDSBSpecFrame(this),STATUS_PTR))
278 #define astSetSideBand(this,val) \
279 astINVOKE(V,astSetSideBand_(astCheckDSBSpecFrame(this),val,STATUS_PTR))
280 
281 #define astGetAlignSideBand(this) \
282 astINVOKE(V,astGetAlignSideBand_(astCheckDSBSpecFrame(this),STATUS_PTR))
283 #define astTestAlignSideBand(this) \
284 astINVOKE(V,astTestAlignSideBand_(astCheckDSBSpecFrame(this),STATUS_PTR))
285 #define astClearAlignSideBand(this) \
286 astINVOKE(V,astClearAlignSideBand_(astCheckDSBSpecFrame(this),STATUS_PTR))
287 #define astSetAlignSideBand(this,val) \
288 astINVOKE(V,astSetAlignSideBand_(astCheckDSBSpecFrame(this),val,STATUS_PTR))
289 
290 #define astGetImagFreq(this) \
291 astINVOKE(V,astGetImagFreq_(astCheckDSBSpecFrame(this),STATUS_PTR))
292 #endif
293 #endif
294 
295 
296 
297 
298 
299