class_docstr: Parse a set/get methods
class_docstr_tok: ["Parse","a","set\/get","methods"]
code: def parse(self, elem, ctxt):
      if ctxt.curr_class and ctxt.access:
          mgs = re.match(r"\s*using .+::(get|set);", elem)
          if mgs:
              assert not ctxt.template
              ctxt.gdict["classes"][ctxt.curr_class].setgets.append(
                  elem.strip(" ;")
              )
              return True
          mgs = re.match(
              r"(\s*)([^\(=\s]+\s+)((get|set)(\(((\w|:)+).*\)))", elem
          )
          if mgs:
              assert not ctxt.template
              ctxt.gdict["classes"][ctxt.curr_class].setgets.append(
                  [
                      mgs.group(4),
                      mgs.group(2),
                      mgs.group(6),
                      mgs.group(3),
                  ]
              )
              # map input-enum to object-type and optional arg
              if mgs.group(4) == "get":  # a getter
                  name = mgs.group(6).strip()
                  if "," in mgs.group(3):
                      arg = (
                          mgs.group(3)
                          .strip(")")
                          .split(",")[1]
                          .strip()
                          .split(" ")
                      )
                      ctxt.gdict["classes"][ctxt.curr_class].arg_gets[
                          name
                      ] = (
                          mgs.group(2).strip(),
                          arg,
                      )
                  else:
                      ctxt.gdict["classes"][ctxt.curr_class].gets[
                          name
                      ] = mgs.group(2).strip()
              else:  # a setter
                  args = (
                      mgs.group(3)
                      .split("{")[0]
                      .strip(")")
                      .strip()
                      .split(",")
                  )
                  name = mgs.group(6).strip()
                  typ = (
                      args[-1]
                      .replace("const", "")
                      .strip()
                      .split(" ")[0]
                      .strip()
                  )
                  if len(args) > 2:
                      val = args[1].strip().split(" ")
                      ctxt.gdict["classes"][ctxt.curr_class].arg_sets[
                          name
                      ] = (typ, val)
                  else:
                      ctxt.gdict["classes"][ctxt.curr_class].sets[
                          name
                      ] = typ
              return True
          regex = (
              r"\s*(?:(?:virtual|DAAL_EXPORT)\s*)?((\w|:|<|>)+)"
              + r"([*&]\s+|\s+[&*]|\s+)(get\w+)\(\s*\)"
          )
          mgs = re.match(regex, elem)
          if mgs:
              name = mgs.group(4)
              if name not in ["getSerializationTag"]:
                  if ctxt.template and name.startswith("get"):
                      assert (
                          len(ctxt.template) == 1
                          and ctxt.template[0][1] == "fptypes"
                      )
                      ctxt.gdict["classes"][ctxt.curr_class].gets[
                          name
                      ] = (
                          "double",
                          "<double>",
                      )
                      return False
                  ctxt.gdict["classes"][ctxt.curr_class].gets[
                      name
                  ] = mgs.group(1)
                  return True
          # some get-methods accept an argument!
          # We support only a single argument for now,
          # and only simple types like int, size_t etc, no refs, no pointers
          regex = (
              r"\s*(?:virtual\s*)?((\w|:|<|>)+)([*&]\s+|\s+[&*]|\s+)"
              + r"(get\w+)\(\s*((?:\w|_)+)\s+((?:\w|_)+)\s*\)"
          )
          mgs = re.match(regex, elem)
          if mgs and mgs.group(4) not in ["getResult", "getInput"]:
              ctxt.gdict["classes"][ctxt.curr_class].gets[
                  mgs.group(4)
              ] = (
                  mgs.group(1),
                  mgs.group(5),
                  mgs.group(6),
              )
              return True
      return False
  
imports: import re
  from collections import OrderedDict, defaultdict
label_desc: Use image node_id 1 for calling the setget_parser obj's underlying member method code with example usage: obj.parse(elem, ctxt) and returns: False, True, True, True, True, False