[contrib][haskell] use Datasource
[hkl.git] / hkl / hkl-sample-private.h
blob4bacdd8e80c2152a07958257945eefc1ec5a03fd
1 /* This file is part of the hkl library.
3 * The hkl library is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
8 * The hkl library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with the hkl library. If not, see <http://www.gnu.org/licenses/>.
16 * Copyright (C) 2003-2017 Synchrotron SOLEIL
17 * L'Orme des Merisiers Saint-Aubin
18 * BP 48 91192 GIF-sur-YVETTE CEDEX
20 * Authors: Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>
22 #ifndef __HKL_SAMPLE_PRIVATE_H__
23 #define __HKL_SAMPLE_PRIVATE_H__
25 #include <stdio.h> // for FILE
26 #include "ccan/list/list.h" // for list_head, list_node
27 #include "hkl-matrix-private.h" // for _HklMatrix
28 #include "hkl-vector-private.h" // for HklVector
29 #include "hkl.h" // for HklParameter, etc
31 G_BEGIN_DECLS
33 /*************/
34 /* HklSample */
35 /*************/
37 struct _HklSample {
38 char *name;
39 HklLattice *lattice;
40 HklMatrix U;
41 HklMatrix UB;
42 HklParameter *ux;
43 HklParameter *uy;
44 HklParameter *uz;
45 struct list_head reflections;
46 size_t n_reflections;
49 #define HKL_SAMPLE_ERROR hkl_sample_error_quark ()
51 static inline GQuark hkl_sample_error_quark (void)
53 return g_quark_from_static_string ("hkl-sample-error-quark");
56 typedef enum {
57 HKL_SAMPLE_ERROR_MINIMIZED, /* can not minimize the sample */
58 HKL_SAMPLE_ERROR_COMPUTE_UB_BUSING_LEVY, /* can not compute UB */
59 } HklSampleError;
62 extern void hkl_sample_fprintf(FILE *f, const HklSample *self);
65 /***********************/
66 /* hklSampleReflection */
67 /***********************/
69 struct _HklSampleReflection {
70 HklGeometry *geometry;
71 HklDetector *detector;
72 HklVector hkl;
73 HklVector _hkl;
74 int flag;
75 struct list_node list;
78 #define HKL_SAMPLE_REFLECTION_ERROR hkl_sample_reflection_error_quark ()
80 static inline GQuark hkl_sample_reflection_error_quark (void)
82 return g_quark_from_static_string ("hkl-sample-reflection-error-quark");
85 typedef enum {
86 HKL_SAMPLE_REFLECTION_ERROR_HKL_SET, /* can not set the hkl part of the reflection */
87 } HklSampleReflectionError;
89 extern HklSampleReflection *hkl_sample_reflection_new_copy(const HklSampleReflection *self);
91 extern void hkl_sample_reflection_free(HklSampleReflection *self);
93 G_END_DECLS
95 #endif