1 /*
2  * Copyright (C) 2008 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef bbf_L01_TLD_2X4_FTR_EM_H
18 #define bbf_L01_TLD_2X4_FTR_EM_H
19 
20 /* ---- includes ----------------------------------------------------------- */
21 
22 #include "b_BasicEm/Context.h"
23 #include "b_BasicEm/Basic.h"
24 #include "b_BasicEm/UInt32Arr.h"
25 #include "b_BasicEm/MemTbl.h"
26 #include "b_BitFeatureEm/Feature.h"
27 
28 /* ---- related objects  --------------------------------------------------- */
29 
30 /* ---- typedefs ----------------------------------------------------------- */
31 
32 /* ---- constants ---------------------------------------------------------- */
33 
34 /* data format version number */
35 #define bbf_L01_TLD_2X4_FTR_VERSION 100
36 
37 /* ---- object definition -------------------------------------------------- */
38 
39 /** discrete feature set */
40 struct bbf_L01Tld2x4Ftr
41 {
42 	/* ---- private data --------------------------------------------------- */
43 
44 	/* ---- public data ---------------------------------------------------- */
45 
46 	/** base element */
47 	struct bbf_Feature baseE;
48 
49 	/** data array */
50 	struct bbs_UInt32Arr dataArrE;
51 
52 	/** factor to convert activity to proper range */
53 	uint32 activityFactorE;
54 };
55 
56 /* ---- associated objects ------------------------------------------------- */
57 
58 /* ---- external functions ------------------------------------------------- */
59 
60 /* ---- \ghd{ constructor/destructor } ------------------------------------- */
61 
62 /** initializes bbf_L01Tld2x4Ftr  */
63 void bbf_L01Tld2x4Ftr_init( struct bbs_Context* cpA,
64 						    struct bbf_L01Tld2x4Ftr* ptrA );
65 
66 /** resets bbf_L01Tld2x4Ftr  */
67 void bbf_L01Tld2x4Ftr_exit( struct bbs_Context* cpA,
68 						    struct bbf_L01Tld2x4Ftr* ptrA );
69 
70 /* ---- \ghd{ operators } -------------------------------------------------- */
71 
72 /** copy operator */
73 void bbf_L01Tld2x4Ftr_copy( struct bbs_Context* cpA,
74 						    struct bbf_L01Tld2x4Ftr* ptrA,
75 						    const struct bbf_L01Tld2x4Ftr* srcPtrA );
76 
77 /** equal operator */
78 flag bbf_L01Tld2x4Ftr_equal( struct bbs_Context* cpA,
79 						     const struct bbf_L01Tld2x4Ftr* ptrA,
80 						     const struct bbf_L01Tld2x4Ftr* srcPtrA );
81 
82 /* ---- \ghd{ query functions } -------------------------------------------- */
83 
84 /* ---- \ghd{ modify functions } ------------------------------------------- */
85 
86 /* ---- \ghd{ memory I/O } ------------------------------------------------- */
87 
88 /** word size (16-bit) object needs when written to memory */
89 uint32 bbf_L01Tld2x4Ftr_memSize( struct bbs_Context* cpA,
90 							     const struct bbf_L01Tld2x4Ftr* ptrA );
91 
92 /** writes object to memory; returns number of words (16-bit) written */
93 uint32 bbf_L01Tld2x4Ftr_memWrite( struct bbs_Context* cpA,
94 							      const struct bbf_L01Tld2x4Ftr* ptrA, uint16* memPtrA );
95 
96 /** reads object from memory; returns number of words (16-bit) read */
97 uint32 bbf_L01Tld2x4Ftr_memRead( struct bbs_Context* cpA,
98 							     struct bbf_L01Tld2x4Ftr* ptrA,
99 							     const uint16* memPtrA,
100 							     struct bbs_MemTbl* mtpA );
101 
102 /* ---- \ghd{ exec functions } --------------------------------------------- */
103 
104 /** computes feature's activity (4.28) on the given patch */
105 int32 bbf_L01Tld2x4Ftr_activity( const struct bbf_Feature* ptrA, const uint32* patchA );
106 
107 #endif /* bbf_L01_TLD_2X4_FTR_EM_H */
108 
109