implemented decmatch (artf724241)
[deliverable/titan.core.git] / core / Bitstring.hh
index ed25023a3ffabb6e6f8a2d08026b1fbb9d46c295..877a564957b20719b4feb2e950e0544dc61abd2b 100644 (file)
@@ -1,10 +1,26 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2000-2014 Ericsson Telecom AB
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// which accompanies this distribution, and is available at
-// http://www.eclipse.org/legal/epl-v10.html
-///////////////////////////////////////////////////////////////////////////////
+/******************************************************************************
+ * Copyright (c) 2000-2016 Ericsson Telecom AB
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Balasko, Jeno
+ *   Baranyi, Botond
+ *   Beres, Szabolcs
+ *   Delic, Adam
+ *   Forstner, Matyas
+ *   Horvath, Gabriella
+ *   Kovacs, Ferenc
+ *   Raduly, Csaba
+ *   Szabados, Kristof
+ *   Szabo, Bence Janos
+ *   Szabo, Janos Zoltan – initial implementation
+ *   Szalai, Gabor
+ *   Tatarka, Gabor
+ *
+ ******************************************************************************/
 #ifndef BITSTRING_HH
 #define BITSTRING_HH
 
@@ -135,6 +151,8 @@ public:
 #endif
 
   void set_param(Module_Param& param);
+  Module_Param* get_param(Module_Param_Name& param_name) const;
+  
   void encode_text(Text_Buf& text_buf) const;
   void decode_text(Text_Buf& text_buf);
 
@@ -172,8 +190,8 @@ public:
   int RAW_decode(const TTCN_Typedescriptor_t& , TTCN_Buffer&, int, raw_order_t,
      boolean no_err=FALSE, int sel_field=-1, boolean first_call=TRUE);
 
-  int XER_encode(const XERdescriptor_t&, TTCN_Buffer&, unsigned int, int) const;
-  int XER_decode(const XERdescriptor_t&, XmlReaderWrap& reader, unsigned int);
+  int XER_encode(const XERdescriptor_t&, TTCN_Buffer&, unsigned int, int, embed_values_enc_struct_t*) const;
+  int XER_decode(const XERdescriptor_t&, XmlReaderWrap& reader, unsigned int, unsigned int, embed_values_dec_struct_t*);
   
   /** Encodes accordingly to the JSON encoding rules.
     * Returns the length of the encoded data. */
@@ -227,6 +245,8 @@ public:
 };
 
 /// bitstring template class
+struct decmatch_struct;
+
 class BITSTRING_template : public Restricted_Length_Template {
 #ifdef __SUNPRO_CC
 public:
@@ -240,6 +260,7 @@ private:
       BITSTRING_template *list_value;
     } value_list;
     bitstring_pattern_struct *pattern_value;
+    decmatch_struct* dec_match;
   };
 
   void copy_template(const BITSTRING_template& other_value);
@@ -269,34 +290,37 @@ public:
   const BITSTRING_ELEMENT operator[](int index_value) const;
   const BITSTRING_ELEMENT operator[](const INTEGER& index_value) const;
 
-  boolean match(const BITSTRING& other_value) const;
+  boolean match(const BITSTRING& other_value, boolean legacy = FALSE) const;
   const BITSTRING& valueof() const;
 
   int lengthof() const;
 
-  void set_type(template_sel template_type, unsigned int list_length);
+  void set_type(template_sel template_type, unsigned int list_length = 0);
   BITSTRING_template& list_item(unsigned int list_index);
+  
+  void set_decmatch(Dec_Match_Interface* new_instance);
 
   void log() const;
-  void log_match(const BITSTRING& match_value) const;
+  void log_match(const BITSTRING& match_value, boolean legacy = FALSE) const;
 
   void set_param(Module_Param& param);
+  Module_Param* get_param(Module_Param_Name& param_name) const;
 
   void encode_text(Text_Buf& text_buf) const;
   void decode_text(Text_Buf& text_buf);
 
-  boolean is_present() const;
-  boolean match_omit() const;
+  boolean is_present(boolean legacy = FALSE) const;
+  boolean match_omit(boolean legacy = FALSE) const;
 #ifdef TITAN_RUNTIME_2
   void valueofv(Base_Type* value) const { *(static_cast<BITSTRING*>(value)) = valueof(); }
   void set_value(template_sel other_value) { *this = other_value; }
   void copy_value(const Base_Type* other_value) { *this = *(static_cast<const BITSTRING*>(other_value)); }
   Base_Template* clone() const { return new BITSTRING_template(*this); }
   const TTCN_Typedescriptor_t* get_descriptor() const { return &BITSTRING_descr_; }
-  boolean matchv(const Base_Type* other_value) const { return match(*(static_cast<const BITSTRING*>(other_value))); }
-  void log_matchv(const Base_Type* match_value) const  { log_match(*(static_cast<const BITSTRING*>(match_value))); }
+  boolean matchv(const Base_Type* other_value, boolean legacy) const { return match(*(static_cast<const BITSTRING*>(other_value)), legacy); }
+  void log_matchv(const Base_Type* match_value, boolean legacy) const  { log_match(*(static_cast<const BITSTRING*>(match_value)), legacy); }
 #else
-  void check_restriction(template_res t_res, const char* t_name=NULL) const;
+  void check_restriction(template_res t_res, const char* t_name=NULL, boolean legacy = FALSE) const;
 #endif
 };
 
This page took 0.026663 seconds and 5 git commands to generate.