text:
{-
(c) The University of Glasgow 2006-2012
(c) The GRASP Project, Glasgow University, 1992-2002

-}

{-# LANGUAGE CPP #-}

module TcSigs(
       TcSigInfo(..),
       TcIdSigInfo(..), TcIdSigInst,
       TcPatSynInfo(..),
       TcSigFun,

       isPartialSig, noCompleteSig, tcIdSigName, tcSigInfoName,
       completeSigPolyId_maybe,

       tcTySigs, tcUserTypeSig, completeSigFromId,
       tcInstSig,

       TcPragEnv, emptyPragEnv, lookupPragEnv, extendPragEnv,
       mkPragEnv, tcSpecPrags, tcSpecWrapper, tcImpPrags, addInlinePrags
   ) where

#include "HsVersions.h"

import HsSyn
import TcHsType
import TcRnTypes
import TcRnMonad
import TcType
import TcMType
import TcUnify( tcSkolemise, unifyType, noThing )
import Inst( topInstantiate )
import TcEnv( tcLookupId )
import TcEvidence( HsWrapper, (<.>) )
import Type( mkTyVarBinders )

import DynFlags
import Var      ( TyVar, tyVarName, tyVarKind )
import Id       ( Id, idName, idType, idInlinePragma, setInlinePragma, mkLocalId )
import PrelNames( mkUnboundName )
import BasicTypes
import Bag( foldrBag )
import Module( getModule )
import Name
import NameEnv
import VarSet
import Outputable
import SrcLoc
import Util( singleton )
import Maybes( orElse )
import Data.Maybe( mapMaybe )
import Control.Monad( unless )

{- -------------------------------------------------------------
          Note [Overview of type signatures]
----------------------------------------------------------------
Type signatures, including partial signatures, are jolly tricky,
especially on value bindings.  Here's an overview.

    f :: forall a. [a] -> [a]
    g :: forall b. _ -> b

    f = ...g...
    g = ...f...

* HsSyn: a signature in a binding starts of as a TypeSig, in
  type HsBinds.Sig

* When starting a mutually recursive group, like f/g above, we
  call tcTySig on each signature in the group.

* tcTySig: Sig -> TcIdSigInfo
  - For a /complete/ signature, like 'f' above, tcTySig kind-checks
    the HsType, producing a Type, and wraps it in a CompleteSig, and
    extend the type environment with this polymorphic 'f'.

  - For a /partial/signauture, like 'g' above, tcTySig does nothing
    Instead it just wraps the pieces in a PartialSig, to be handled
    later.

* tcInstSig: TcIdSigInfo -> TcIdSigInst
  In tcMonoBinds, when looking at an individual binding, we use
  tcInstSig to instantiate the signature forall's in the signature,
  and attribute that instantiated (monomorphic) type to the
  binder.  You can see this in TcBinds.tcLhsId.

  The instantiation does the obvious thing for complete signatures,
  but for /partial/ signatures it starts from the HsSyn, so it
  has to kind-check it etc: tcHsPartialSigType.  It's convenient
  to do this at the same time as instantiation, because we can
  make the wildcards into unification variables right away, raather
  than somehow quantifying over them.  And the "TcLevel" of those
  unification variables is correct because we are in tcMonoBinds.

Note [Scoped tyvars]
~~~~~~~~~~~~~~~~~~~~
The -XScopedTypeVariables flag brings lexically-scoped type variables
into scope for any explicitly forall-quantified type variables:
        f :: forall a. a -> a
        f x = e
Then 'a' is in scope inside 'e'.

However, we do *not* support this
  - For pattern bindings e.g
        f :: forall a. a->a
        (f,g) = e

Note [Binding scoped type variables]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The type variables *brought into lexical scope* by a type signature
may be a subset of the *quantified type variables* of the signatures,
for two reasons:

* With kind polymorphism a signature like
    f :: forall f a. f a -> f a
  may actually give rise to
    f :: forall k. forall (f::k -> *) (a:k). f a -> f a
  So the sig_tvs will be [k,f,a], but only f,a are scoped.
  NB: the scoped ones are not necessarily the *inital* ones!

* Even aside from kind polymorphism, there may be more instantiated
  type variables than lexically-scoped ones.  For example:
        type T a = forall b. b -> (a,b)
        f :: forall c. T c
  Here, the signature for f will have one scoped type variable, c,
  but two instantiated type variables, c' and b'.

However, all of this only applies to the renamer.  The typechecker
just puts all of them into the type environment; any lexical-scope
errors were dealt with by the renamer.

-}

{- *********************************************************************
*                                                                      *
             Utility functions for TcSigInfo
*                                                                      *
********************************************************************* -}

type TcSigFun  = Name -> Maybe TcSigInfo

-- | No signature or a partial signature
noCompleteSig :: Maybe TcSigInfo -> Bool
noCompleteSig (Just (TcIdSig (CompleteSig {}))) = False
noCompleteSig _                                 = True

tcIdSigName :: TcIdSigInfo -> Name
tcIdSigName (CompleteSig { sig_bndr = id }) = idName id
tcIdSigName (PartialSig { psig_name = n })  = n

tcSigInfoName :: TcSigInfo -> Name
tcSigInfoName (TcIdSig     idsi) = tcIdSigName idsi
tcSigInfoName (TcPatSynSig tpsi) = patsig_name tpsi

completeSigPolyId_maybe :: TcSigInfo -> Maybe TcId
completeSigPolyId_maybe sig
  | TcIdSig sig_info <- sig
  , CompleteSig { sig_bndr = id } <- sig_info = Just id
  | otherwise                                 = Nothing

{- *********************************************************************
*                                                                      *
               Typechecking user signatures
*                                                                      *
********************************************************************* -}

tcTySigs :: [LSig Name] -> TcM ([TcId], TcSigFun)
tcTySigs hs_sigs
  = checkNoErrs $   -- See Note [Fail eagerly on bad signatures]
    do { ty_sigs_s <- mapAndRecoverM tcTySig hs_sigs
       ; let ty_sigs  = concat ty_sigs_s
             poly_ids = mapMaybe completeSigPolyId_maybe ty_sigs
                        -- The returned [TcId] are the ones for which we have
                        -- a complete type signature.
                        -- See Note [Complete and partial type signatures]
             env = mkNameEnv [(tcSigInfoName sig, sig) | sig <- ty_sigs]
       ; return (poly_ids, lookupNameEnv env) }

tcTySig :: LSig Name -> TcM [TcSigInfo]
tcTySig (L _ (IdSig id))
  = do { let ctxt = FunSigCtxt (idName id) False
                    -- False: do not report redundant constraints
                    -- The user has no control over the signature!
             sig = completeSigFromId ctxt id
       ; return [TcIdSig sig] }

tcTySig (L loc (TypeSig names sig_ty))
  = setSrcSpan loc $
    do { sigs <- sequence [ tcUserTypeSig loc sig_ty (Just name)
                          | L _ name <- names ]
       ; return (map TcIdSig sigs) }

tcTySig (L loc (PatSynSig names sig_ty))
  = setSrcSpan loc $
    do { tpsigs <- sequence [ tcPatSynSig name sig_ty
                            | L _ name <- names ]
       ; return (map TcPatSynSig tpsigs) }

tcTySig _ = return []

tcUserTypeSig :: SrcSpan -> LHsSigWcType Name -> Maybe Name -> TcM TcIdSigInfo
-- A function or expression type signature
-- Returns a fully quantified type signature; even the wildcards
-- are quantified with ordinary skolems that should be instantiated
--
-- The SrcSpan is what to declare as the binding site of the
-- any skolems in the signature. For function signatures we
-- use the whole `f :: ty' signature; for expression signatures
-- just the type part.
--
-- Just n  => Function type signature       name :: type
-- Nothing => Expression type signature   <expr> :: type
tcUserTypeSig loc hs_sig_ty mb_name
  | isCompleteHsSig hs_sig_ty
  = do { sigma_ty <- tcHsSigWcType ctxt_F hs_sig_ty
       ; return $
         CompleteSig { sig_bndr  = mkLocalId name sigma_ty
                     , sig_ctxt  = ctxt_T
                     , sig_loc   = loc } }
                       -- Location of the <type> in   f :: <type>

  -- Partial sig with wildcards
  | otherwise
  = return (PartialSig { psig_name = name, psig_hs_ty = hs_sig_ty
                       , sig_ctxt = ctxt_F, sig_loc = loc })
  where
    name   = case mb_name of
               Just n  -> n
               Nothing -> mkUnboundName (mkVarOcc "<expression>")
    ctxt_F = case mb_name of
               Just n  -> FunSigCtxt n False
               Nothing -> ExprSigCtxt
    ctxt_T = case mb_name of
               Just n  -> FunSigCtxt n True
               Nothing -> ExprSigCtxt

completeSigFromId :: UserTypeCtxt -> Id -> TcIdSigInfo
-- Used for instance methods and record selectors
completeSigFromId ctxt id
  = CompleteSig { sig_bndr = id
                , sig_ctxt = ctxt
                , sig_loc  = getSrcSpan id }

isCompleteHsSig :: LHsSigWcType Name -> Bool
-- ^ If there are no wildcards, return a LHsSigType
isCompleteHsSig (HsWC { hswc_wcs = wcs }) = null wcs

{- Note [Fail eagerly on bad signatures]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If a type signaure is wrong, fail immediately:

 * the type sigs may bind type variables, so proceeding without them
   can lead to a cascade of errors

 * the type signature might be ambiguous, in which case checking
   the code against the signature will give a very similar error
   to the ambiguity error.

ToDo: this means we fall over if any type sig
is wrong (eg at the top level of the module),
which is over-conservative
-}

{- *********************************************************************
*                                                                      *
        Type checking a pattern synonym signature
*                                                                      *
************************************************************************

Note [Pattern synonym signatures]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pattern synonym signatures are surprisingly tricky (see Trac #11224 for example).
In general they look like this:

   pattern P :: forall univ_tvs. req_theta
             => forall ex_tvs. prov_theta
             => arg1 -> .. -> argn -> res_ty

For parsing and renaming we treat the signature as an ordinary LHsSigType.

Once we get to type checking, we decompose it into its parts, in tcPatSynSig.

* Note that 'forall univ_tvs' and 'req_theta =>'
        and 'forall ex_tvs'   and 'prov_theta =>'
  are all optional.  We gather the pieces at the the top of tcPatSynSig

* Initially the implicitly-bound tyvars (added by the renamer) include both
  universal and existential vars.

* After we kind-check the pieces and convert to Types, we do kind generalisation.

Note [The pattern-synonym signature splitting rule]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Given a pattern signature, we must split
     the kind-generalised variables, and
     the implicitly-bound variables
into universal and existential.  The rule is this
(see discussion on Trac #11224):

     The universal tyvars are the ones mentioned in
          - univ_tvs: the user-specified (forall'd) universals
          - req_theta
          - res_ty
     The existential tyvars are all the rest

For example

   pattern P :: () => b -> T a
   pattern P x = ...

Here 'a' is universal, and 'b' is existential.  But there is a wrinkle:
how do we split the arg_tys from req_ty?  Consider

   pattern Q :: () => b -> S c -> T a
   pattern Q x = ...

This is an odd example because Q has only one syntactic argument, and
so presumably is defined by a view pattern matching a function.  But
it can happen (Trac #11977, #12108).

We don't know Q's arity from the pattern signature, so we have to wait
until we see the pattern declaration itself before deciding res_ty is,
and hence which variables are existential and which are universal.

And that in turn is why TcPatSynInfo has a separate field,
patsig_implicit_bndrs, to capture the implicitly bound type variables,
because we don't yet know how to split them up.

It's a slight compromise, because it means we don't really know the
pattern synonym's real signature until we see its declaration.  So,
for example, in hs-boot file, we may need to think what to do...
(eg don't have any implicitly-bound variables).
-}

tcPatSynSig :: Name -> LHsSigType Name -> TcM TcPatSynInfo
tcPatSynSig name sig_ty
  | HsIB { hsib_vars = implicit_hs_tvs
         , hsib_body = hs_ty }  <- sig_ty
  , (univ_hs_tvs, hs_req,  hs_ty1)     <- splitLHsSigmaTy hs_ty
  , (ex_hs_tvs,   hs_prov, hs_body_ty) <- splitLHsSigmaTy hs_ty1
  = do { (implicit_tvs, (univ_tvs, req, ex_tvs, prov, body_ty))
           <- solveEqualities $
              tcImplicitTKBndrs implicit_hs_tvs $
              tcExplicitTKBndrs univ_hs_tvs  $ \ univ_tvs ->
              tcExplicitTKBndrs ex_hs_tvs    $ \ ex_tvs   ->
              do { req     <- tcHsContext hs_req
                 ; prov    <- tcHsContext hs_prov
                 ; body_ty <- tcHsOpenType hs_body_ty
                     -- A (literal) pattern can be unlifted;
                     -- e.g. pattern Zero <- 0#   (Trac #12094)
                 ; let bound_tvs
                         = unionVarSets [ allBoundVariabless req
                                        , allBoundVariabless prov
                                        , allBoundVariables body_ty
                                        ]
                 ; return ( (univ_tvs, req, ex_tvs, prov, body_ty)
                          , bound_tvs) }

       -- Kind generalisation
       ; kvs <- kindGeneralize $
                mkSpecForAllTys (implicit_tvs ++ univ_tvs) $
                mkFunTys req $
                mkSpecForAllTys ex_tvs $
                mkFunTys prov $
                body_ty

       -- These are /signatures/ so we zonk to squeeze out any kind
       -- unification variables.  Do this after quantifyTyVars which may
       -- default kind variables to *.
       -- ToDo: checkValidType?
       ; traceTc "about zonk" empty
       ; implicit_tvs <- mapM zonkTcTyCoVarBndr implicit_tvs
       ; univ_tvs     <- mapM zonkTcTyCoVarBndr univ_tvs
       ; ex_tvs       <- mapM zonkTcTyCoVarBndr ex_tvs
       ; req          <- zonkTcTypes req
       ; prov         <- zonkTcTypes prov
       ; body_ty      <- zonkTcType  body_ty

       ; traceTc "tcTySig }" $
         vcat [ text "implicit_tvs" <+> ppr_tvs implicit_tvs
              , text "kvs" <+> ppr_tvs kvs
              , text "univ_tvs" <+> ppr_tvs univ_tvs
              , text "req" <+> ppr req
              , text "ex_tvs" <+> ppr_tvs ex_tvs
              , text "prov" <+> ppr prov
              , text "body_ty" <+> ppr body_ty ]
       ; return (TPSI { patsig_name = name
                      , patsig_implicit_bndrs = mkTyVarBinders Inferred kvs ++
                                                mkTyVarBinders Specified implicit_tvs
                      , patsig_univ_bndrs     = univ_tvs
                      , patsig_req            = req
                      , patsig_ex_bndrs       = ex_tvs
                      , patsig_prov           = prov
                      , patsig_body_ty        = body_ty }) }
  where

ppr_tvs :: [TyVar] -> SDoc
ppr_tvs tvs = braces (vcat [ ppr tv <+> dcolon <+> ppr (tyVarKind tv)
                           | tv <- tvs])

{- *********************************************************************
*                                                                      *
               Instantiating user signatures
*                                                                      *
********************************************************************* -}

tcInstSig :: TcIdSigInfo -> TcM TcIdSigInst
-- Instantiate a type signature; only used with plan InferGen
tcInstSig sig@(CompleteSig { sig_bndr = poly_id, sig_loc = loc })
  = setSrcSpan loc $  -- Set the binding site of the tyvars
    do { (tv_prs, theta, tau) <- tcInstType newMetaSigTyVars poly_id
              -- See Note [Pattern bindings and complete signatures]

       ; return (TISI { sig_inst_sig   = sig
                      , sig_inst_skols = tv_prs
                      , sig_inst_wcs   = []
                      , sig_inst_wcx   = Nothing
                      , sig_inst_theta = theta
                      , sig_inst_tau   = tau }) }

tcInstSig sig@(PartialSig { psig_hs_ty = hs_ty
                          , sig_ctxt = ctxt
                          , sig_loc = loc })
  = setSrcSpan loc $  -- Set the binding site of the tyvars
    do { (wcs, wcx, tvs, theta, tau) <- tcHsPartialSigType ctxt hs_ty
       ; return (TISI { sig_inst_sig   = sig
                      , sig_inst_skols = map (\tv -> (tyVarName tv, tv)) tvs
                      , sig_inst_wcs   = wcs
                      , sig_inst_wcx   = wcx
                      , sig_inst_theta = theta
                      , sig_inst_tau   = tau }) }

{- Note [Pattern bindings and complete signatures]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider
      data T a = MkT a a
      f :: forall a. a->a
      g :: forall b. b->b
      MkT f g = MkT (\x->x) (\y->y)
Here we'll infer a type from the pattern of 'T a', but if we feed in
the signature types for f and g, we'll end up unifying 'a' and 'b'

So we instantiate f and g's signature with SigTv skolems
(newMetaSigTyVars) that can unify with each other.  If too much
unification takes place, we'll find out when we do the final
impedence-matching check in TcBinds.mkExport

See Note [Signature skolems] in TcType

None of this applies to a function binding with a complete
signature, which doesn't use tcInstSig.  See TcBinds.tcPolyCheck.
-}

{- *********************************************************************
*                                                                      *
                   Pragmas and PragEnv
*                                                                      *
********************************************************************* -}

type TcPragEnv = NameEnv [LSig Name]

emptyPragEnv :: TcPragEnv
emptyPragEnv = emptyNameEnv

lookupPragEnv :: TcPragEnv -> Name -> [LSig Name]
lookupPragEnv prag_fn n = lookupNameEnv prag_fn n `orElse` []

extendPragEnv :: TcPragEnv -> (Name, LSig Name) -> TcPragEnv
extendPragEnv prag_fn (n, sig) = extendNameEnv_Acc (:) singleton prag_fn n sig

---------------
mkPragEnv :: [LSig Name] -> LHsBinds Name -> TcPragEnv
mkPragEnv sigs binds
  = foldl extendPragEnv emptyNameEnv prs
  where
    prs = mapMaybe get_sig sigs

    get_sig :: LSig Name -> Maybe (Name, LSig Name)
    get_sig (L l (SpecSig lnm@(L _ nm) ty inl)) = Just (nm, L l $ SpecSig   lnm ty (add_arity nm inl))
    get_sig (L l (InlineSig lnm@(L _ nm) inl))  = Just (nm, L l $ InlineSig lnm    (add_arity nm inl))
    get_sig (L l (SCCFunSig st lnm@(L _ nm) str))  = Just (nm, L l $ SCCFunSig st lnm str)
    get_sig _                                   = Nothing

    add_arity n inl_prag   -- Adjust inl_sat field to match visible arity of function
      | Inline <- inl_inline inl_prag
        -- add arity only for real INLINE pragmas, not INLINABLE
      = case lookupNameEnv ar_env n of
          Just ar -> inl_prag { inl_sat = Just ar }
          Nothing -> WARN( True, text "mkPragEnv no arity" <+> ppr n )
                     -- There really should be a binding for every INLINE pragma
                     inl_prag
      | otherwise
      = inl_prag

    -- ar_env maps a local to the arity of its definition
    ar_env :: NameEnv Arity
    ar_env = foldrBag lhsBindArity emptyNameEnv binds

lhsBindArity :: LHsBind Name -> NameEnv Arity -> NameEnv Arity
lhsBindArity (L _ (FunBind { fun_id = id, fun_matches = ms })) env
  = extendNameEnv env (unLoc id) (matchGroupArity ms)
lhsBindArity _ env = env        -- PatBind/VarBind

-----------------
addInlinePrags :: TcId -> [LSig Name] -> TcM TcId
addInlinePrags poly_id prags_for_me
  | inl@(L _ prag) : inls <- inl_prags
  = do { traceTc "addInlinePrag" (ppr poly_id $$ ppr prag)
       ; unless (null inls) (warn_multiple_inlines inl inls)
       ; return (poly_id `setInlinePragma` prag) }
  | otherwise
  = return poly_id
  where
    inl_prags = [L loc prag | L loc (InlineSig _ prag) <- prags_for_me]

    warn_multiple_inlines _ [] = return ()

    warn_multiple_inlines inl1@(L loc prag1) (inl2@(L _ prag2) : inls)
       | inlinePragmaActivation prag1 == inlinePragmaActivation prag2
       , isEmptyInlineSpec (inlinePragmaSpec prag1)
       =    -- Tiresome: inl1 is put there by virtue of being in a hs-boot loop
            -- and inl2 is a user NOINLINE pragma; we don't want to complain
         warn_multiple_inlines inl2 inls
       | otherwise
       = setSrcSpan loc $
         addWarnTc NoReason
                     (hang (text "Multiple INLINE pragmas for" <+> ppr poly_id)
                       2 (vcat (text "Ignoring all but the first"
                                : map pp_inl (inl1:inl2:inls))))

    pp_inl (L loc prag) = ppr prag <+> parens (ppr loc)

{- *********************************************************************
*                                                                      *
                   SPECIALISE pragmas
*                                                                      *
************************************************************************

Note [Handling SPECIALISE pragmas]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The basic idea is this:

   foo :: Num a => a -> b -> a
   {-# SPECIALISE foo :: Int -> b -> Int #-}

We check that
   (forall a b. Num a => a -> b -> a)
      is more polymorphic than
   forall b. Int -> b -> Int
(for which we could use tcSubType, but see below), generating a HsWrapper
to connect the two, something like
      wrap = /\b. <hole> Int b dNumInt
This wrapper is put in the TcSpecPrag, in the ABExport record of
the AbsBinds.

        f :: (Eq a, Ix b) => a -> b -> Bool
        {-# SPECIALISE f :: (Ix p, Ix q) => Int -> (p,q) -> Bool #-}
        f = <poly_rhs>

From this the typechecker generates

    AbsBinds [ab] [d1,d2] [([ab], f, f_mono, prags)] binds

    SpecPrag (wrap_fn :: forall a b. (Eq a, Ix b) => XXX
                      -> forall p q. (Ix p, Ix q) => XXX[ Int/a, (p,q)/b ])

From these we generate:

    Rule:       forall p, q, (dp:Ix p), (dq:Ix q).
                    f Int (p,q) dInt ($dfInPair dp dq) = f_spec p q dp dq

    Spec bind:  f_spec = wrap_fn <poly_rhs>

Note that

  * The LHS of the rule may mention dictionary *expressions* (eg
    $dfIxPair dp dq), and that is essential because the dp, dq are
    needed on the RHS.

  * The RHS of f_spec, <poly_rhs> has a *copy* of 'binds', so that it
    can fully specialise it.

From the TcSpecPrag, in DsBinds we generate a binding for f_spec and a RULE:

   f_spec :: Int -> b -> Int
   f_spec = wrap<f rhs>

   RULE: forall b (d:Num b). f b d = f_spec b

The RULE is generated by taking apart the HsWrapper, which is a little
delicate, but works.

Some wrinkles

1. We don't use full-on tcSubType, because that does co and contra
   variance and that in turn will generate too complex a LHS for the
   RULE.  So we use a single invocation of skolemise /
   topInstantiate in tcSpecWrapper.  (Actually I think that even
   the "deeply" stuff may be too much, because it introduces lambdas,
   though I think it can be made to work without too much trouble.)

2. We need to take care with type families (Trac #5821).  Consider
      type instance F Int = Bool
      f :: Num a => a -> F a
      {-# SPECIALISE foo :: Int -> Bool #-}

  We *could* try to generate an f_spec with precisely the declared type:
      f_spec :: Int -> Bool
      f_spec = <f rhs> Int dNumInt |> co

      RULE: forall d. f Int d = f_spec |> sym co

  but the 'co' and 'sym co' are (a) playing no useful role, and (b) are
  hard to generate.  At all costs we must avoid this:
      RULE: forall d. f Int d |> co = f_spec
  because the LHS will never match (indeed it's rejected in
  decomposeRuleLhs).

  So we simply do this:
    - Generate a constraint to check that the specialised type (after
      skolemiseation) is equal to the instantiated function type.
    - But *discard* the evidence (coercion) for that constraint,
      so that we ultimately generate the simpler code
          f_spec :: Int -> F Int
          f_spec = <f rhs> Int dNumInt

          RULE: forall d. f Int d = f_spec
      You can see this discarding happening in

3. Note that the HsWrapper can transform *any* function with the right
   type prefix
       forall ab. (Eq a, Ix b) => XXX
   regardless of XXX.  It's sort of polymorphic in XXX.  This is
   useful: we use the same wrapper to transform each of the class ops, as
   well as the dict.  That's what goes on in TcInstDcls.mk_meth_spec_prags
-}

tcSpecPrags :: Id -> [LSig Name]
            -> TcM [LTcSpecPrag]
-- Add INLINE and SPECIALSE pragmas
--    INLINE prags are added to the (polymorphic) Id directly
--    SPECIALISE prags are passed to the desugarer via TcSpecPrags
-- Pre-condition: the poly_id is zonked
-- Reason: required by tcSubExp
tcSpecPrags poly_id prag_sigs
  = do { traceTc "tcSpecPrags" (ppr poly_id <+> ppr spec_sigs)
       ; unless (null bad_sigs) warn_discarded_sigs
       ; pss <- mapAndRecoverM (wrapLocM (tcSpecPrag poly_id)) spec_sigs
       ; return $ concatMap (\(L l ps) -> map (L l) ps) pss }
  where
    spec_sigs = filter isSpecLSig prag_sigs
    bad_sigs  = filter is_bad_sig prag_sigs
    is_bad_sig s = not (isSpecLSig s || isInlineLSig s || isSCCFunSig s)

    warn_discarded_sigs
      = addWarnTc NoReason
                  (hang (text "Discarding unexpected pragmas for" <+> ppr poly_id)
                      2 (vcat (map (ppr . getLoc) bad_sigs)))

--------------
tcSpecPrag :: TcId -> Sig Name -> TcM [TcSpecPrag]
tcSpecPrag poly_id prag@(SpecSig fun_name hs_tys inl)
-- See Note [Handling SPECIALISE pragmas]
--
-- The Name fun_name in the SpecSig may not be the same as that of the poly_id
-- Example: SPECIALISE for a class method: the Name in the SpecSig is
--          for the selector Id, but the poly_id is something like $cop
-- However we want to use fun_name in the error message, since that is
-- what the user wrote (Trac #8537)
  = addErrCtxt (spec_ctxt prag) $
    do  { warnIf NoReason (not (isOverloadedTy poly_ty || isInlinePragma inl))
                 (text "SPECIALISE pragma for non-overloaded function"
                  <+> quotes (ppr fun_name))
                  -- Note [SPECIALISE pragmas]
        ; spec_prags <- mapM tc_one hs_tys
        ; traceTc "tcSpecPrag" (ppr poly_id $$ nest 2 (vcat (map ppr spec_prags)))
        ; return spec_prags }
  where
    name      = idName poly_id
    poly_ty   = idType poly_id
    spec_ctxt prag = hang (text "In the SPECIALISE pragma") 2 (ppr prag)

    tc_one hs_ty
      = do { spec_ty <- tcHsSigType   (FunSigCtxt name False) hs_ty
           ; wrap    <- tcSpecWrapper (FunSigCtxt name True)  poly_ty spec_ty
           ; return (SpecPrag poly_id wrap inl) }

tcSpecPrag _ prag = pprPanic "tcSpecPrag" (ppr prag)

--------------
tcSpecWrapper :: UserTypeCtxt -> TcType -> TcType -> TcM HsWrapper
-- A simpler variant of tcSubType, used for SPECIALISE pragmas
-- See Note [Handling SPECIALISE pragmas], wrinkle 1
tcSpecWrapper ctxt poly_ty spec_ty
  = do { (sk_wrap, inst_wrap)
               <- tcSkolemise ctxt spec_ty $ \ _ spec_tau ->
                  do { (inst_wrap, tau) <- topInstantiate orig poly_ty
                     ; _ <- unifyType noThing spec_tau tau
                            -- Deliberately ignore the evidence
                            -- See Note [Handling SPECIALISE pragmas],
                            --   wrinkle (2)
                     ; return inst_wrap }
       ; return (sk_wrap <.> inst_wrap) }
  where
    orig = SpecPragOrigin ctxt

--------------
tcImpPrags :: [LSig Name] -> TcM [LTcSpecPrag]
-- SPECIALISE pragmas for imported things
tcImpPrags prags
  = do { this_mod <- getModule
       ; dflags <- getDynFlags
       ; if (not_specialising dflags) then
            return []
         else do
            { pss <- mapAndRecoverM (wrapLocM tcImpSpec)
                     [L loc (name,prag)
                               | (L loc prag@(SpecSig (L _ name) _ _)) <- prags
                               , not (nameIsLocalOrFrom this_mod name) ]
            ; return $ concatMap (\(L l ps) -> map (L l) ps) pss } }
  where
    -- Ignore SPECIALISE pragmas for imported things
    -- when we aren't specialising, or when we aren't generating
    -- code.  The latter happens when Haddocking the base library;
    -- we don't wnat complaints about lack of INLINABLE pragmas
    not_specialising dflags
      | not (gopt Opt_Specialise dflags) = True
      | otherwise = case hscTarget dflags of
                      HscNothing -> True
                      HscInterpreted -> True
                      _other         -> False

tcImpSpec :: (Name, Sig Name) -> TcM [TcSpecPrag]
tcImpSpec (name, prag)
 = do { id <- tcLookupId name
      ; unless (isAnyInlinePragma (idInlinePragma id))
               (addWarnTc NoReason (impSpecErr name))
      ; tcSpecPrag id prag }

impSpecErr :: Name -> SDoc
impSpecErr name
  = hang (text "You cannot SPECIALISE" <+> quotes (ppr name))
       2 (vcat [ text "because its definition has no INLINE/INLINABLE pragma"
               , parens $ sep
                   [ text "or its defining module" <+> quotes (ppr mod)
                   , text "was compiled without -O"]])
  where
    mod = nameModule name


text:
package extract;
import Embedding.*;

public class Rescaling {
    int[] orSize;

    public double[][] Rescaling(double[][] wmImage, int[] size) {
        ReadParameter parameter = new ReadParameter();
        Imread image = new Imread();
        Dwt wavelet = new Dwt();

        double[][] originalImage = image.Imread(parameter.getOriginalImageName());
        orSize = image.Size();

        int wSize = orSize[0]/size[0];

        double[][] intermediate = new double[wmImage.length][wmImage[0].length];
        double[][] rescaledImage = new double[originalImage.length][originalImage[0].length];

        if(wSize>1){
            for(int i=0;i<wmImage.length;i++){
                for(int j=0;j<wmImage[0].length;j++){
                    intermediate[i][j] = wmImage[i][j]*Math.pow(2,wSize-1);
                }
            }

            int level = parameter.getDecompLevel() - (wSize - 1);
            intermediate = wavelet.dwt(intermediate,size,level,parameter.getWaveletName());

            for(int m=0;m<intermediate.length;m++){
                for(int n=0;n<intermediate[0].length;n++){
                    rescaledImage[m][n] = intermediate[m][n];
                }
            }

        } else{
            rescaledImage = wavelet.dwt(wmImage,size,parameter.getDecompLevel(),parameter.getWaveletName());
        }

        return rescaledImage;
    }

    public int[] getOriginalImageSize(){
        return orSize;
    }

}

redpajama_set_name: RedPajamaGithub


text:
package com.jonathancolt.nicity.view.core;

/*
 * #%L
 * nicity-view
 * %%
 * Copyright (C) 2013 Jonathan Colt
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import com.jonathancolt.nicity.view.border.EditTextBorder;

/**
 *
 * @author Administrator
 */
public class VPassword extends Viewer {

    /**
     *
     * @param _string
     */
    public void stringChanged(String _string) {
    }

    /**
     *
     * @param _string
     */
    public void stringSet(String _string) {
    }
    private EditString editString;

    /**
     *
     */
    public VPassword() {
        this(null, null, null);
    }

    /**
     *
     * @param _text
     */
    public VPassword(Object _text) {
        this(_text, null, null);
    }

    /**
     *
     * @param _text
     * @param _color
     */
    public VPassword(Object _text, AColor _color) {
        this(_text, null, _color);
    }

    /**
     *
     * @param _text
     * @param _font
     */
    public VPassword(Object _text, AFont _font) {
        this(_text, _font, null);
    }

    /**
     *
     * @param _text
     * @param _font
     * @param _color
     */
    public VPassword(Object _text, AFont _font, AColor _color) {
        editString = new EditString(_text, _font, _color) {

            @Override
            public void stringChanged(String _string) {
                super.stringChanged(_string);
                VPassword.this.stringChanged(_string);
            }

            @Override
            public void stringSet(String _string) {
                super.stringSet(_string);
                VPassword.this.stringSet(_string);
            }
        };
        editString.password = true;
        setPlacer(new Placer(editString));
        setBorder(new EditTextBorder());
    }

    /**
     *
     * @param _text
     */
    public VPassword(EditString _text) {
        editString = _text;
        editString.password = true;
        setPlacer(new Placer(editString));
        setBorder(new EditTextBorder());
    }

    /**
     *
     * @param _text
     * @param _minW
     * @param _maxW
     */
    public VPassword(Object _text, float _minW, float _maxW) {
        editString = new EditString(_text, _minW, _maxW);
        editString.password = true;
        setPlacer(new Placer(editString));
        setBorder(new EditTextBorder());
    }

    /**
     *
     * @param _text
     */
    public void setText(Object _text) {
        editString.setCaret(0);
        editString.setText(_text);
    }

    @Override
    public void mend() {
        enableFlag(UV.cRepair);//??
        super.mend();
    }

    /**
     *
     * @return
     */
    public EditString getEditString() {
        return editString;
    }

    @Override
    public String toString() {
        return editString.toString();
    }
}


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CSharpCanvas;

namespace CSharpCanvasConsoleTest
{
    class Program
    {
        static void Main(string[] args)
        {
            //var test1Js = File.ReadAllText("files/test1/no_draw_image.js");

            //CanvasScriptEngine.RenderScriptWith2dContextToPng("test1.png", "pdf", test1Js, 904, 1279);

            //Process.Start("test1.png");

            //var test1Js = File.ReadAllText("files/test2/draw_image.js");

            //CanvasScriptEngine.RenderScriptWith2dContextToPng("test2.png", "pdf", test1Js, 904, 1279);

            //Process.Start("test2.png");

            var test3Js = File.ReadAllText("files/test3/draw_image_failed.js");

            CanvasScriptEngine.RenderScriptWith2dContextToPng("test3.png", "pdf", test3Js, 904, 1279);

            Process.Start("test3.png");
        }
    }
}


text:
<?php

namespace CmsContact\View\Helper;

/**
 * View helper for rendering email.
 */
class Email extends Contact
{
    /**
     * {@inheritDoc}
     */
    protected function format()
    {
        $value = $this->getRawValue();
        $value = '' . $value . '';
        $this->setValue($value);
        return parent::format();
    }
}


text:
package org.elasticsearch.gradle.testclusters;

import org.gradle.api.Task;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.tasks.Nested;

import java.util.Collection;
import java.util.concurrent.Callable;

public interface TestClustersAware extends Task {

    @Nested
    Collection<ElasticsearchCluster> getClusters();

    default void useCluster(ElasticsearchCluster cluster) {
        if (cluster.getPath().equals(getProject().getPath()) == false) {
            throw new TestClustersException("Task " + getPath() + " can't use test cluster from" + " another project " + cluster);
        }

        cluster.getNodes()
            .stream()
            .flatMap(node -> node.getDistributions().stream())
            .forEach(distro -> dependsOn(getProject().provider(() -> distro.maybeFreeze())));
        cluster.getNodes().forEach(node -> dependsOn((Callable<Collection<Configuration>>) node::getPluginAndModuleConfigurations));
        getClusters().add(cluster);
    }

    default void beforeStart() {}
}


text:
package com.projectd.colorfullife;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Random;

import com.projectd.colorfullife.data.DataArchive;
import com.projectd.colorfullife.game.GamePlayer;
import com.projectd.colorfullife.view.game.WindowDialogData;
import com.projectd.colorfullife.view.game.WindowDialogData.WindowDialogDisplayType;

public class GameManager {
	public enum GameState{
		GAME_START,
		TURN_START,	//»ØºÏ¿ªÊ¼
		TURN_WAIT,	//µÈ´ýÓû§²Ù×÷
		TURN_DICE,	//Ͷ÷»×Ó
		TURN_DIECD,	//Ͷ÷»×Ó½áÊø
		TURN_MOVE,	//Òƶ¯
		TURN_MOVED,	//Òƶ¯Íê±Ï
		TURN_EVENT, //'þ´¥·¢
		TURN_END,	//»ØºÏ½áÊø
		GAME_END,
		NONE, TURN_SELECT, TURN_AI_SELECT,GAME_LOADED
	}
	public static ArrayList<GamePlayer> players = new ArrayList<GamePlayer>();
	public static GameState state = GameState.NONE;
	public static int activePlayerIndex;
	public static int dayCount;
	public static int age;
	public static int moveCount;
	public static boolean nowRcDice;
	public static boolean nowSpeedUp;
	public static ArrayList<String> messages = new ArrayList<String>();
	private static void initializeOppoments() {
		GamePlayer player1 = players.get(0);
		GamePlayer player2 = players.get(1);
		GamePlayer player3 = players.get(2);
		GamePlayer player4 = players.get(3);
		player1.opponents.add(player2);
		player1.opponents.add(player3);
		player1.opponents.add(player4);

		player2.opponents.add(player1);
		player2.opponents.add(player3);
		player2.opponents.add(player4);

		player3.opponents.add(player1);
		player3.opponents.add(player2);
		player3.opponents.add(player4);

		player4.opponents.add(player1);
		player4.opponents.add(player2);
		player4.opponents.add(player3);
	}

	public static void initializeGame(int[] characterSelectIndex) {
		players.clear();
		dialogs.clear();

		GamePlayer player1 = new GamePlayer(characterSelectIndex[0]);
		GamePlayer player2 = new GamePlayer(characterSelectIndex[1]);
		GamePlayer player3 = new GamePlayer(characterSelectIndex[2]);
		GamePlayer player4 = new GamePlayer(characterSelectIndex[3]);

		players.add(player1);
		players.add(player2);
		players.add(player3);
		players.add(player4);

		//player4.isAi = true;

		dayCount = 1;
		activePlayerIndex = 0;
		state = GameState.GAME_START;
		nowRcDice = false;
		nowSpeedUp = false;
		moveCount = 0;
		messages.clear();
		age = 0;

//		for (int i = 0; i < 6; i++) {
//			player1.items[i] += 10;
//		}

		initializeOppoments();

	}
	public static DataArchive saveToDataArchive() {
		DataArchive setData = new DataArchive();
		for(int i = 0; i < 4; i++){
			setData.playersCash[i] = players.get(i).cash;
			setData.playersStopCount[i] = players.get(i).stopCount;
			setData.playersRushCount[i] = players.get(i).rushCount;
			setData.playersCredit[i] = players.get(i).credit;
			setData.playersHp[i] = players.get(i).getHp();
			setData.playersMaxHp[i] = players.get(i).maxHp;
			setData.playersSlowCount[i] = players.get(i).slowCount;
			setData.playersMapIndex[i] = players.get(i).mapIndex;
			setData.achievementPoint[i] = players.get(i).achievementPoint;
			setData.isAi[i] = players.get(i).isAi;
			setData.isMoreCareer[i] = players.get(i).isMoreSl;
			setData.characterId[i] = players.get(i).characterIndex;
			setData.careerId[i] = players.get(i).careerId;
			setData.salary[i] = players.get(i).salary;
			setData.hplost[i] = players.get(i).hpLost;
			setData.cashlost[i] = players.get(i).cashLost;
			setData.invest[i] = players.get(i).investMoney;
			setData.isLI[i] = players.get(i).lifeInsurance;
			setData.isAI[i] = players.get(i).autoInsurance;
			setData.isEnd[i] = players.get(i).isEnd;
			setData.isFakeEnd[i] = players.get(i).isFakeEnd;
			setData.isMarried[i] = players.get(i).isMarried;
			for (int j = 0; j < 6; j++) {
				setData.items[i][j] = players.get(i).items[j];
			}
		}
		setData.activePlayerIndex = GameManager.activePlayerIndex;
		setData.dayCount = GameManager.dayCount;
		setData.age = GameManager.age;
		setData.nowRcDice = GameManager.nowRcDice;
		setData.nowSpeedUp = GameManager.nowSpeedUp;
		setData.saveTime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()).toString();
		return setData;
	}
	public static void loadFromDataArchive(DataArchive setData) {
		players.clear();
		dialogs.clear();
		GamePlayer player1 = new GamePlayer(setData.characterId[0]);
		GamePlayer player2 = new GamePlayer(setData.characterId[1]);
		GamePlayer player3 = new GamePlayer(setData.characterId[2]);
		GamePlayer player4 = new GamePlayer(setData.characterId[3]);
		players.add(player1);
		players.add(player2);
		players.add(player3);
		players.add(player4);
		for (int i = 0; i < 4; i++) {
			players.get(i).cash = setData.playersCash[i];
			players.get(i).stopCount = setData.playersStopCount[i];
			players.get(i).rushCount = setData.playersRushCount[i];
			players.get(i).credit = setData.playersCredit[i];
			players.get(i).setHp(setData.playersHp[i]);
			players.get(i).maxHp = setData.playersMaxHp[i];
			players.get(i).slowCount = setData.playersSlowCount[i];
			players.get(i).mapIndex = setData.playersMapIndex[i];
			players.get(i).achievementPoint = setData.achievementPoint[i];
			players.get(i).isAi = setData.isAi[i];
			players.get(i).isMoreSl = setData.isMoreCareer[i];
			players.get(i).characterIndex = setData.characterId[i];
			players.get(i).careerId = setData.careerId[i];
			players.get(i).salary = setData.salary[i];
			players.get(i).hpLost = setData.hplost[i];
			players.get(i).cashLost = setData.cashlost[i];
			for (int j = 0; j < 6; j++) {
				players.get(i).items[j] = setData.items[i][j];
			}
			players.get(i).investMoney = setData.invest[i];
			players.get(i).lifeInsurance = setData.isLI[i];
			players.get(i).autoInsurance = setData.isAI[i];
			players.get(i).isEnd = setData.isEnd[i];
			players.get(i).isFakeEnd = setData.isFakeEnd[i];
			players.get(i).isMarried = setData.isMarried[i];
			players.get(i).isMarried = setData.isMarried[i];
		}
		GameManager.activePlayerIndex = setData.activePlayerIndex;
		GameManager.age = setData.age;
		GameManager.dayCount = setData.dayCount;
		GameManager.nowRcDice = setData.nowRcDice;
		GameManager.nowSpeedUp = setData.nowSpeedUp;
		state = GameState.TURN_WAIT;
		initializeOppoments();
	}

	/**Ëæ»úÖÖ×Ó*/
	public static Random seed = new Random();

	public static ArrayList<WindowDialogData> dialogs = new ArrayList<WindowDialogData>();

	/**Çл»ÖÁÏÂһλÍæ¼Ò*/
	public static int nextPlayer() {
		activePlayerIndex += 1;
		if(activePlayerIndex >= players.size()){
			dayCount += 1;
			activePlayerIndex = 0;
		}
		return activePlayerIndex;
	}
	/**»ñÈ¡µ±Ç°Íæ¼Ò*/
	public static final GamePlayer getActivePlayer() {
		return players.get(activePlayerIndex);
	}

	/**ÍÆËÍжԻ°
	 * @param setDialogText ÏÔʾµÄÎÄ×Ö
	 * @param setType ÏÔʾ·½Ê½
	 * @param setIndex ÉãÏñ»úÌøתÍæ¼ÒË÷Òý*/
	public static final void addNewDialog(String setDialogText,WindowDialogDisplayType setType, int setIndex) {
		if(SystemManager.isShowDialog == false){
			return;
		}
		WindowDialogData dialog = new WindowDialogData();
		dialog.dialogText = setDialogText;
		dialog.displayType = setType;
		int x = DataManager.tiles.get(players.get(setIndex).mapIndex).mapX;
		int y = DataManager.tiles.get(players.get(setIndex).mapIndex).mapY;
		dialog.moveCameraX = x;
		dialog.moveCameraY = y;
		dialogs.add(dialog);
	}

}


text:
// ***********************************************************************
// <copyright file="PostgreSqlStringConverters.cs" company="ServiceStack, Inc.">
//     Copyright (c) ServiceStack, Inc. All Rights Reserved.
// </copyright>
// <summary>Fork for YetAnotherForum.NET, Licensed under the Apache License, Version 2.0</summary>
// ***********************************************************************

namespace ServiceStack.OrmLite.PostgreSQL.Converters;

using ServiceStack.DataAnnotations;
using ServiceStack.OrmLite.Converters;

/// <summary>
/// Class PostgreSqlStringConverter.
/// Implements the <see cref="ServiceStack.OrmLite.Converters.StringConverter" />
/// </summary>
/// <seealso cref="ServiceStack.OrmLite.Converters.StringConverter" />
public class PostgreSqlStringConverter : StringConverter
{
    /// <summary>
    /// SQL Column Definition used in CREATE Table.
    /// </summary>
    /// <value>The column definition.</value>
    public override string ColumnDefinition => "TEXT";

    //https://dba.stackexchange.com/questions/189876/size-limit-of-character-varying-postgresql
    /// <summary>
    /// Gets the maximum length of the variable character.
    /// </summary>
    /// <value>The maximum length of the variable character.</value>
    public override int MaxVarCharLength => UseUnicode ? 10485760 / 2 : 10485760;

    /// <summary>
    /// Gets the column definition.
    /// </summary>
    /// <param name="stringLength">Length of the string.</param>
    /// <returns>System.String.</returns>
    public override string GetColumnDefinition(int? stringLength)
    {
        //PostgreSQL doesn't support NVARCHAR when UseUnicode = true so just use TEXT
        if (stringLength == null || stringLength == StringLengthAttribute.MaxText)
            return ColumnDefinition;

        return $"VARCHAR({stringLength.Value})";
    }
}

/// <summary>
/// Class PostgreSqlCharArrayConverter.
/// Implements the <see cref="ServiceStack.OrmLite.Converters.CharArrayConverter" />
/// </summary>
/// <seealso cref="ServiceStack.OrmLite.Converters.CharArrayConverter" />
public class PostgreSqlCharArrayConverter : CharArrayConverter
{
    /// <summary>
    /// SQL Column Definition used in CREATE Table.
    /// </summary>
    /// <value>The column definition.</value>
    public override string ColumnDefinition => "TEXT";

    /// <summary>
    /// Gets the column definition.
    /// </summary>
    /// <param name="stringLength">Length of the string.</param>
    /// <returns>System.String.</returns>
    public override string GetColumnDefinition(int? stringLength)
    {
        return ColumnDefinition;
    }
}


text:
/////////////////////////////////////////////////////////////////////////////
// Name:        src/msw/dialog.cpp
// Purpose:     wxDialog class
// Author:      Julian Smart
// Modified by:
// Created:     01/02/97
// RCS-ID:      $Id: dialog.cpp,v 1.125 2005/09/02 08:20:05 VZ Exp $
// Copyright:   (c) Julian Smart
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

// ============================================================================
// declarations
// ============================================================================

// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------

#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
    #pragma implementation "dialog.h"
#endif

// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
    #pragma hdrstop
#endif

#ifndef WX_PRECOMP
    #include "wx/dialog.h"
    #include "wx/utils.h"
    #include "wx/frame.h"
    #include "wx/app.h"
    #include "wx/button.h"
    #include "wx/settings.h"
    #include "wx/intl.h"
    #include "wx/log.h"
#endif

#include "wx/msw/private.h"
#include "wx/log.h"
#include "wx/evtloop.h"
#include "wx/ptr_scpd.h"

#include "wx/msw/wrapcdlg.h"

#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
    #include "wx/msw/wince/resources.h"
#endif // __SMARTPHONE__ && __WXWINCE__

#if wxUSE_TOOLBAR && defined(__POCKETPC__)
#include "wx/toolbar.h"
#endif

// ----------------------------------------------------------------------------
// wxWin macros
// ----------------------------------------------------------------------------

#if wxUSE_EXTENDED_RTTI
WX_DEFINE_FLAGS( wxDialogStyle )

wxBEGIN_FLAGS( wxDialogStyle )
    // new style border flags, we put them first to
    // use them for streaming out
    wxFLAGS_MEMBER(wxBORDER_SIMPLE)
    wxFLAGS_MEMBER(wxBORDER_SUNKEN)
    wxFLAGS_MEMBER(wxBORDER_DOUBLE)
    wxFLAGS_MEMBER(wxBORDER_RAISED)
    wxFLAGS_MEMBER(wxBORDER_STATIC)
    wxFLAGS_MEMBER(wxBORDER_NONE)

    // old style border flags
    wxFLAGS_MEMBER(wxSIMPLE_BORDER)
    wxFLAGS_MEMBER(wxSUNKEN_BORDER)
    wxFLAGS_MEMBER(wxDOUBLE_BORDER)
    wxFLAGS_MEMBER(wxRAISED_BORDER)
    wxFLAGS_MEMBER(wxSTATIC_BORDER)
    wxFLAGS_MEMBER(wxNO_BORDER)

    // standard window styles
    wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
    wxFLAGS_MEMBER(wxCLIP_CHILDREN)

    // dialog styles
    wxFLAGS_MEMBER(wxWS_EX_VALIDATE_RECURSIVELY)
    wxFLAGS_MEMBER(wxSTAY_ON_TOP)
    wxFLAGS_MEMBER(wxCAPTION)
    wxFLAGS_MEMBER(wxTHICK_FRAME)
    wxFLAGS_MEMBER(wxSYSTEM_MENU)
    wxFLAGS_MEMBER(wxRESIZE_BORDER)
    wxFLAGS_MEMBER(wxRESIZE_BOX)
    wxFLAGS_MEMBER(wxCLOSE_BOX)
    wxFLAGS_MEMBER(wxMAXIMIZE_BOX)
    wxFLAGS_MEMBER(wxMINIMIZE_BOX)
wxEND_FLAGS( wxDialogStyle )

IMPLEMENT_DYNAMIC_CLASS_XTI(wxDialog, wxTopLevelWindow,"wx/dialog.h")

wxBEGIN_PROPERTIES_TABLE(wxDialog)
    wxPROPERTY( Title, wxString, SetTitle, GetTitle, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
    wxPROPERTY_FLAGS( WindowStyle , wxDialogStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
wxEND_PROPERTIES_TABLE()

wxBEGIN_HANDLERS_TABLE(wxDialog)
wxEND_HANDLERS_TABLE()

wxCONSTRUCTOR_6( wxDialog , wxWindow* , Parent , wxWindowID , Id , wxString , Title , wxPoint , Position , wxSize , Size , long , WindowStyle)

#else
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow)
#endif

BEGIN_EVENT_TABLE(wxDialog, wxDialogBase)
    EVT_BUTTON(wxID_OK, wxDialog::OnOK)
    EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
    EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)

    EVT_SYS_COLOUR_CHANGED(wxDialog::OnSysColourChanged)

    EVT_CLOSE(wxDialog::OnCloseWindow)
END_EVENT_TABLE()

// ----------------------------------------------------------------------------
// wxDialogModalData
// ----------------------------------------------------------------------------

// this is simply a container for any data we need to implement modality which
// allows us to avoid changing wxDialog each time the implementation changes
class wxDialogModalData
{
public:
    wxDialogModalData(wxDialog *dialog) : m_evtLoop(dialog) { }

    void RunLoop()
    {
        m_evtLoop.Run();
    }

    void ExitLoop()
    {
        m_evtLoop.Exit();
    }

private:
    wxModalEventLoop m_evtLoop;
};

wxDEFINE_TIED_SCOPED_PTR_TYPE(wxDialogModalData);

// ============================================================================
// implementation
// ============================================================================

// ----------------------------------------------------------------------------
// wxDialog construction
// ----------------------------------------------------------------------------

void wxDialog::Init()
{
    m_oldFocus = (wxWindow *)NULL;
    m_isShown = false;
    m_modalData = NULL;
    m_endModalCalled = false;
#if wxUSE_TOOLBAR && defined(__POCKETPC__)
    m_dialogToolBar = NULL;
#endif
}

bool wxDialog::Create(wxWindow *parent,
                      wxWindowID id,
                      const wxString& title,
                      const wxPoint& pos,
                      const wxSize& size,
                      long style,
                      const wxString& name)
{
    SetExtraStyle(GetExtraStyle() | wxTOPLEVEL_EX_DIALOG);

    // save focus before doing anything which can potentially change it
    m_oldFocus = FindFocus();

    // All dialogs should really have this style
    style |= wxTAB_TRAVERSAL;

    if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) )
        return false;

    if ( !m_hasFont )
        SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));

#if defined(__SMARTPHONE__) && defined(__WXWINCE__)
    SetLeftMenu(wxID_OK, _("OK"));
#endif
#if wxUSE_TOOLBAR && defined(__POCKETPC__)
    CreateToolBar();
#endif

    return true;
}

// deprecated ctor
wxDialog::wxDialog(wxWindow *parent,
                   const wxString& title,
                   bool WXUNUSED(modal),
                   int x,
                   int y,
                   int w,
                   int h,
                   long style,
                   const wxString& name)
{
    Init();

    Create(parent, wxID_ANY, title, wxPoint(x, y), wxSize(w, h), style, name);
}

void wxDialog::SetModal(bool WXUNUSED(flag))
{
    // nothing to do, obsolete method
}

wxDialog::~wxDialog()
{
    m_isBeingDeleted = true;

    // this will also reenable all the other windows for a modal dialog
    Show(false);
}

// ----------------------------------------------------------------------------
// showing the dialogs
// ----------------------------------------------------------------------------

bool wxDialog::IsModalShowing() const
{
    return IsModal();
}

wxWindow *wxDialog::FindSuitableParent() const
{
    // first try to use the currently active window
    HWND hwndFg = ::GetForegroundWindow();
    wxWindow *parent = hwndFg ? wxFindWinFromHandle((WXHWND)hwndFg)
                              : NULL;
    if ( !parent )
    {
        // next try the main app window
        parent = wxTheApp->GetTopWindow();
    }

    // finally, check if the parent we found is really suitable
    if ( !parent || parent == (wxWindow *)this || !parent->IsShown() )
    {
        // don't use this one
        parent = NULL;
    }

    return parent;
}

bool wxDialog::Show(bool show)
{
    if ( show == IsShown() )
        return false;

    if ( !show && m_modalData )
    {
        // we need to do this before calling wxDialogBase version because if we
        // had disabled other app windows, they must be reenabled right now as
        // if they stay disabled Windows will activate another window (one
        // which is enabled, anyhow) when we're hidden in the base class Show()
        // and we will lose activation
        m_modalData->ExitLoop();
    }

    if ( show )
    {
        // this usually will result in TransferDataToWindow() being called
        // which will change the controls values so do it before showing as
        // otherwise we could have some flicker
        InitDialog();
    }

    wxDialogBase::Show(show);

    if ( show )
    {
        // dialogs don't get WM_SIZE message after creation unlike most (all?)
        // other windows and so could start their life non laid out correctly
        // if we didn't call Layout() from here
        //
        // NB: normally we should call it just the first time but doing it
        //     every time is simpler than keeping a flag
        Layout();
    }

    return true;
}

void wxDialog::Raise()
{
    ::SetForegroundWindow(GetHwnd());
}

// show dialog modally
int wxDialog::ShowModal()
{
    wxASSERT_MSG( !IsModal(), _T("wxDialog::ShowModal() reentered?") );

    m_endModalCalled = false;

    Show();

    // EndModal may have been called from InitDialog handler (called from
    // inside Show()), which would cause an infinite loop if we didn't take it
    // into account
    if ( !m_endModalCalled )
    {
        // modal dialog needs a parent window, so try to find one
        wxWindow *parent = GetParent();
        if ( !parent )
        {
            parent = FindSuitableParent();
        }

        // remember where the focus was
        wxWindow *oldFocus = m_oldFocus;
        if ( !oldFocus )
        {
            // VZ: do we really want to do this?
            oldFocus = parent;
        }

        // We have to remember the HWND because we need to check
        // the HWND still exists (oldFocus can be garbage when the dialog
        // exits, if it has been destroyed)
        HWND hwndOldFocus = oldFocus ? GetHwndOf(oldFocus) : NULL;

        // enter and run the modal loop
        {
            wxDialogModalDataTiedPtr modalData(&m_modalData,
                                               new wxDialogModalData(this));
            modalData->RunLoop();
        }

        // and restore focus
        // Note that this code MUST NOT access the dialog object's data
        // in case the object has been deleted (which will be the case
        // for a modal dialog that has been destroyed before calling EndModal).
        if ( oldFocus && (oldFocus != this) && ::IsWindow(hwndOldFocus))
        {
            // This is likely to prove that the object still exists
            if (wxFindWinFromHandle((WXHWND) hwndOldFocus) == oldFocus)
                oldFocus->SetFocus();
        }
    }

    return GetReturnCode();
}

void wxDialog::EndModal(int retCode)
{
    wxASSERT_MSG( IsModal(), _T("EndModal() called for non modal dialog") );

    m_endModalCalled = true;
    SetReturnCode(retCode);

    Hide();
}

void wxDialog::EndDialog(int rc)
{
    if ( IsModal() )
        EndModal(rc);
    else
        Hide();
}

// ----------------------------------------------------------------------------
// wxWin event handlers
// ----------------------------------------------------------------------------

bool wxDialog::EmulateButtonClickIfPresent(int id)
{
    wxButton *btn = wxDynamicCast(FindWindow(id), wxButton);

    if ( !btn || !btn->IsEnabled() || !btn->IsShown() )
        return false;

    btn->MSWCommand(BN_CLICKED, 0 /* unused */);
    return true;
}

// Standard buttons
void wxDialog::OnOK(wxCommandEvent& WXUNUSED(event))
{
  if ( Validate() && TransferDataFromWindow() )
  {
      EndDialog(wxID_OK);
  }
}

void wxDialog::OnApply(wxCommandEvent& WXUNUSED(event))
{
    if ( Validate() )
        TransferDataFromWindow();

    // TODO probably need to disable the Apply button until things change again
}

void wxDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
{
    EndDialog(wxID_CANCEL);
}

void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
{
    // We'll send a Cancel message by default, which may close the dialog.
    // Check for looping if the Cancel event handler calls Close().

    // Note that if a cancel button and handler aren't present in the dialog,
    // nothing will happen when you close the dialog via the window manager, or
    // via Close(). We wouldn't want to destroy the dialog by default, since
    // the dialog may have been created on the stack. However, this does mean
    // that calling dialog->Close() won't delete the dialog unless the handler
    // for wxID_CANCEL does so. So use Destroy() if you want to be sure to
    // destroy the dialog. The default OnCancel (above) simply ends a modal
    // dialog, and hides a modeless dialog.

    // VZ: this is horrible and MT-unsafe. Can't we reuse some of these global
    //     lists here? don't dare to change it now, but should be done later!
    static wxList closing;

    if ( closing.Member(this) )
        return;

    closing.Append(this);

    wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
    cancelEvent.SetEventObject( this );
    GetEventHandler()->ProcessEvent(cancelEvent); // This may close the dialog

    closing.DeleteObject(this);
}

void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
{
    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
    Refresh();
}

#ifdef __POCKETPC__
// Responds to the OK button in a PocketPC titlebar. This
// can be overridden, or you can change the id used for
// sending the event, by calling SetAffirmativeId.
bool wxDialog::DoOK()
{
    const int idOk = GetAffirmativeId();
    if ( EmulateButtonClickIfPresent(idOk) )
        return true;

    wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetAffirmativeId());
    event.SetEventObject(this);

    return GetEventHandler()->ProcessEvent(event);
}
#endif // __POCKETPC__

#if wxUSE_TOOLBAR && defined(__POCKETPC__)
// create main toolbar by calling OnCreateToolBar()
wxToolBar* wxDialog::CreateToolBar(long style, wxWindowID winid, const wxString& name)
{
    m_dialogToolBar = OnCreateToolBar(style, winid, name);

    return m_dialogToolBar;
}

// return a new toolbar
wxToolBar *wxDialog::OnCreateToolBar(long style,
                                       wxWindowID winid,
                                       const wxString& name)
{
    return new wxToolMenuBar(this, winid,
                         wxDefaultPosition, wxDefaultSize,
                         style, name);
}
#endif

// ---------------------------------------------------------------------------
// dialog Windows messages processing
// ---------------------------------------------------------------------------

bool wxDialog::MSWProcessMessage(WXMSG* pMsg)
{
    const MSG * const msg = wx_reinterpret_cast(MSG *, pMsg);
    if ( msg->message == WM_KEYDOWN && msg->wParam == VK_ESCAPE )
    {
        int idCancel = GetEscapeId();
        switch ( idCancel )
        {
            case wxID_NONE:
                // don't handle Esc specially at all
                break;

            case wxID_ANY:
                // this value is special: it means translate Esc to wxID_CANCEL
                // but if there is no such button, then fall back to wxID_OK
                if ( EmulateButtonClickIfPresent(wxID_CANCEL) )
                    return true;
                idCancel = wxID_OK;
                // fall through

            default:
                // translate Esc to button press for the button with given id
                if ( EmulateButtonClickIfPresent(idCancel) )
                    return true;
        }
    }

    return wxDialogBase::MSWProcessMessage(pMsg);
}

WXLRESULT wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
    WXLRESULT rc = 0;
    bool processed = false;

    switch ( message )
    {
#ifdef __WXWINCE__
        // react to pressing the OK button in the title
        case WM_COMMAND:
        {
            switch ( LOWORD(wParam) )
            {
#ifdef __POCKETPC__
                case IDOK:
                    processed = DoOK();
                    if (!processed)
                        processed = !Close();
#endif
#ifdef __SMARTPHONE__
                case IDM_LEFT:
                case IDM_RIGHT:
                    processed = HandleCommand( LOWORD(wParam) , 0 , NULL );
                    break;
#endif // __SMARTPHONE__
            }
            break;
        }
#endif
        case WM_CLOSE:
            // if we can't close, tell the system that we processed the
            // message - otherwise it would close us
            processed = !Close();
            break;

        case WM_SIZE:
            // the Windows dialogs unfortunately are not meant to be resizeable
            // at all and their standard class doesn't include CS_[VH]REDRAW
            // styles which means that the window is not refreshed properly
            // after the resize and no amount of WS_CLIPCHILDREN/SIBLINGS can
            // help with it - so we have to refresh it manually which certainly
            // creates flicker but at least doesn't show garbage on the screen
            rc = wxWindow::MSWWindowProc(message, wParam, lParam);
            processed = true;
            if ( HasFlag(wxFULL_REPAINT_ON_RESIZE) )
            {
                ::InvalidateRect(GetHwnd(), NULL, false /* erase bg */);
            }
            break;

#ifndef __WXMICROWIN__
        case WM_SETCURSOR:
            // we want to override the busy cursor for modal dialogs:
            // typically, wxBeginBusyCursor() is called and then a modal dialog
            // is shown, but the modal dialog shouldn't have hourglass cursor
            if ( IsModal() && wxIsBusy() )
            {
                // set our cursor for all windows (but see below)
                wxCursor cursor = m_cursor;
                if ( !cursor.Ok() )
                    cursor = wxCURSOR_ARROW;

                ::SetCursor(GetHcursorOf(cursor));

                // in any case, stop here and don't let wxWindow process this
                // message (it would set the busy cursor)
                processed = true;

                // but return false to tell the child window (if the event
                // comes from one of them and not from ourselves) that it can
                // set its own cursor if it has one: thus, standard controls
                // (e.g. text ctrl) still have correct cursors in a dialog
                // invoked while wxIsBusy()
                rc = false;
            }
            break;
#endif // __WXMICROWIN__
    }

    if ( !processed )
        rc = wxWindow::MSWWindowProc(message, wParam, lParam);

    return rc;
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>V8 API Reference Guide for node.js v8.9.4: v8::CpuProfileNode Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

V8 API Reference Guide for node.js v8.9.4

Main Page

Related Pages

Namespaces

Classes

Files

Examples

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Hierarchy

Class Members

v8

CpuProfileNode

Classes |
Public Member Functions |
Static Public Attributes |
List of all members

v8::CpuProfileNode Class Reference

#include <v8-profiler.h>

Classes

struct  	LineTick

Public Member Functions

Local< String > 	GetFunctionName () const

const char * 	GetFunctionNameStr () const

int 	GetScriptId () const

Local< String > 	GetScriptResourceName () const

const char * 	GetScriptResourceNameStr () const

int 	GetLineNumber () const

int 	GetColumnNumber () const

unsigned int 	GetHitLineCount () const

bool 	GetLineTicks (LineTick *entries, unsigned int length) const

const char * 	GetBailoutReason () const

unsigned 	GetHitCount () const

 	V8_DEPRECATE_SOON ("Use GetScriptId, GetLineNumber, and GetColumnNumber instead.", unsigned GetCallUid() const)

unsigned 	GetNodeId () const

int 	GetChildrenCount () const

const CpuProfileNode * 	GetChild (int index) const

const std::vector< CpuProfileDeoptInfo > & 	GetDeoptInfos () const

Static Public Attributes

static const int 	kNoLineNumberInfo = Message::kNoLineNumberInfo

static const int 	kNoColumnNumberInfo = Message::kNoColumnInfo

Detailed Description

CpuProfileNode represents a node in a call graph.

Member Function Documentation

          const char* v8::CpuProfileNode::GetBailoutReason
          (
          	)
           const

Returns bailout reason for the function if the optimization was disabled for it.

          const CpuProfileNode* v8::CpuProfileNode::GetChild
          (
          int
          index	)
           const

Retrieves a child node by index.

          int v8::CpuProfileNode::GetChildrenCount
          (
          	)
           const

Returns child nodes count of the node.

          int v8::CpuProfileNode::GetColumnNumber
          (
          	)
           const

Returns 1-based number of the column where the function originates. kNoColumnNumberInfo if no column number information is available.

          const std::vector<CpuProfileDeoptInfo>& v8::CpuProfileNode::GetDeoptInfos
          (
          	)
           const

Retrieves deopt infos for the node.

          Local<String> v8::CpuProfileNode::GetFunctionName
          (
          	)
           const

Returns function name (empty string for anonymous functions.)

          const char* v8::CpuProfileNode::GetFunctionNameStr
          (
          	)
           const

Returns function name (empty string for anonymous functions.) The string ownership is not passed to the caller. It stays valid until profile is deleted. The function is thread safe.

          unsigned v8::CpuProfileNode::GetHitCount
          (
          	)
           const

Returns the count of samples where the function was currently executing.

          unsigned int v8::CpuProfileNode::GetHitLineCount
          (
          	)
           const

Returns the number of the function's source lines that collect the samples.

          int v8::CpuProfileNode::GetLineNumber
          (
          	)
           const

Returns the number, 1-based, of the line where the function originates. kNoLineNumberInfo if no line number information is available.

          bool v8::CpuProfileNode::GetLineTicks
          (
          LineTick *
          entries,

          unsigned int
          length

          )
          	 const

Returns the set of source lines that collect the samples. The caller allocates buffer and responsible for releasing it. True if all available entries are copied, otherwise false. The function copies nothing if buffer is not large enough.

          unsigned v8::CpuProfileNode::GetNodeId
          (
          	)
           const

Returns id of the node. The id is unique within the tree

          int v8::CpuProfileNode::GetScriptId
          (
          	)
           const

Returns id of the script where function is located.

          Local<String> v8::CpuProfileNode::GetScriptResourceName
          (
          	)
           const

Returns resource name for script from where the function originates.

          const char* v8::CpuProfileNode::GetScriptResourceNameStr
          (
          	)
           const

Returns resource name for script from where the function originates. The string ownership is not passed to the caller. It stays valid until profile is deleted. The function is thread safe.

          v8::CpuProfileNode::V8_DEPRECATE_SOON
          (
          "Use
          GetScriptId,

          GetLineNumber
          ,

          and GetColumnNumber instead."
          ,

          unsigned GetCallUid()
          const

          )

Returns function entry UID.

The documentation for this class was generated from the following file:

deps/v8/include/v8-profiler.h

<address class="footer">
Generated by

 1.8.11
</address>


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/aiplatform/v1beta1/index_service.proto

package com.google.cloud.aiplatform.v1beta1;

/**
 *
 *
 *

 * Request message for [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1beta1.IndexService.RemoveDatapoints]
 *

 *
 * Protobuf type {@code google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest}
 */
public final class RemoveDatapointsRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest)
    RemoveDatapointsRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use RemoveDatapointsRequest.newBuilder() to construct.
  private RemoveDatapointsRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private RemoveDatapointsRequest() {
    index_ = "";
    datapointIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new RemoveDatapointsRequest();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.aiplatform.v1beta1.IndexServiceProto
        .internal_static_google_cloud_aiplatform_v1beta1_RemoveDatapointsRequest_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.aiplatform.v1beta1.IndexServiceProto
        .internal_static_google_cloud_aiplatform_v1beta1_RemoveDatapointsRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest.class,
            com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest.Builder.class);
  }

  public static final int INDEX_FIELD_NUMBER = 1;
  private volatile java.lang.Object index_;
  /**
   *
   *
   *

   * Required. The name of the Index resource to be updated.
   * Format:
   * `projects/{project}/locations/{location}/indexes/{index}`
   *

   *
   *
   * string index = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   *
   *
   * @return The index.
   */
  @java.lang.Override
  public java.lang.String getIndex() {
    java.lang.Object ref = index_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      index_ = s;
      return s;
    }
  }
  /**
   *
   *
   *

   * Required. The name of the Index resource to be updated.
   * Format:
   * `projects/{project}/locations/{location}/indexes/{index}`
   *

   *
   *
   * string index = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   *
   *
   * @return The bytes for index.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getIndexBytes() {
    java.lang.Object ref = index_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      index_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DATAPOINT_IDS_FIELD_NUMBER = 2;
  private com.google.protobuf.LazyStringList datapointIds_;
  /**
   *
   *
   *

   * A list of datapoint ids to be deleted.
   *

   *
   * repeated string datapoint_ids = 2;
   *
   * @return A list containing the datapointIds.
   */
  public com.google.protobuf.ProtocolStringList getDatapointIdsList() {
    return datapointIds_;
  }
  /**
   *
   *
   *

   * A list of datapoint ids to be deleted.
   *

   *
   * repeated string datapoint_ids = 2;
   *
   * @return The count of datapointIds.
   */
  public int getDatapointIdsCount() {
    return datapointIds_.size();
  }
  /**
   *
   *
   *

   * A list of datapoint ids to be deleted.
   *

   *
   * repeated string datapoint_ids = 2;
   *
   * @param index The index of the element to return.
   * @return The datapointIds at the given index.
   */
  public java.lang.String getDatapointIds(int index) {
    return datapointIds_.get(index);
  }
  /**
   *
   *
   *

   * A list of datapoint ids to be deleted.
   *

   *
   * repeated string datapoint_ids = 2;
   *
   * @param index The index of the value to return.
   * @return The bytes of the datapointIds at the given index.
   */
  public com.google.protobuf.ByteString getDatapointIdsBytes(int index) {
    return datapointIds_.getByteString(index);
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(index_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, index_);
    }
    for (int i = 0; i < datapointIds_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, datapointIds_.getRaw(i));
    }
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(index_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, index_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < datapointIds_.size(); i++) {
        dataSize += computeStringSizeNoTag(datapointIds_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getDatapointIdsList().size();
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest other =
        (com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest) obj;

    if (!getIndex().equals(other.getIndex())) return false;
    if (!getDatapointIdsList().equals(other.getDatapointIdsList())) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + INDEX_FIELD_NUMBER;
    hash = (53 * hash) + getIndex().hashCode();
    if (getDatapointIdsCount() > 0) {
      hash = (37 * hash) + DATAPOINT_IDS_FIELD_NUMBER;
      hash = (53 * hash) + getDatapointIdsList().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(
      com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   *

   * Request message for [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1beta1.IndexService.RemoveDatapoints]
   *

   *
   * Protobuf type {@code google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest)
      com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.aiplatform.v1beta1.IndexServiceProto
          .internal_static_google_cloud_aiplatform_v1beta1_RemoveDatapointsRequest_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.aiplatform.v1beta1.IndexServiceProto
          .internal_static_google_cloud_aiplatform_v1beta1_RemoveDatapointsRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest.class,
              com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest.Builder.class);
    }

    // Construct using com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      index_ = "";

      datapointIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000001);
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.aiplatform.v1beta1.IndexServiceProto
          .internal_static_google_cloud_aiplatform_v1beta1_RemoveDatapointsRequest_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest getDefaultInstanceForType() {
      return com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest build() {
      com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest buildPartial() {
      com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest result =
          new com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest(this);
      int from_bitField0_ = bitField0_;
      result.index_ = index_;
      if (((bitField0_ & 0x00000001) != 0)) {
        datapointIds_ = datapointIds_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000001);
      }
      result.datapointIds_ = datapointIds_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest) {
        return mergeFrom((com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest other) {
      if (other == com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest.getDefaultInstance())
        return this;
      if (!other.getIndex().isEmpty()) {
        index_ = other.index_;
        onChanged();
      }
      if (!other.datapointIds_.isEmpty()) {
        if (datapointIds_.isEmpty()) {
          datapointIds_ = other.datapointIds_;
          bitField0_ = (bitField0_ & ~0x00000001);
        } else {
          ensureDatapointIdsIsMutable();
          datapointIds_.addAll(other.datapointIds_);
        }
        onChanged();
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                index_ = input.readStringRequireUtf8();

                break;
              } // case 10
            case 18:
              {
                java.lang.String s = input.readStringRequireUtf8();
                ensureDatapointIdsIsMutable();
                datapointIds_.add(s);
                break;
              } // case 18
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private java.lang.Object index_ = "";
    /**
     *
     *
     *

     * Required. The name of the Index resource to be updated.
     * Format:
     * `projects/{project}/locations/{location}/indexes/{index}`
     *

     *
     *
     * string index = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     *
     *
     * @return The index.
     */
    public java.lang.String getIndex() {
      java.lang.Object ref = index_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        index_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     *

     * Required. The name of the Index resource to be updated.
     * Format:
     * `projects/{project}/locations/{location}/indexes/{index}`
     *

     *
     *
     * string index = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     *
     *
     * @return The bytes for index.
     */
    public com.google.protobuf.ByteString getIndexBytes() {
      java.lang.Object ref = index_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        index_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     *

     * Required. The name of the Index resource to be updated.
     * Format:
     * `projects/{project}/locations/{location}/indexes/{index}`
     *

     *
     *
     * string index = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     *
     *
     * @param value The index to set.
     * @return This builder for chaining.
     */
    public Builder setIndex(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      index_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Required. The name of the Index resource to be updated.
     * Format:
     * `projects/{project}/locations/{location}/indexes/{index}`
     *

     *
     *
     * string index = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     *
     *
     * @return This builder for chaining.
     */
    public Builder clearIndex() {

      index_ = getDefaultInstance().getIndex();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Required. The name of the Index resource to be updated.
     * Format:
     * `projects/{project}/locations/{location}/indexes/{index}`
     *

     *
     *
     * string index = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     *
     *
     * @param value The bytes for index to set.
     * @return This builder for chaining.
     */
    public Builder setIndexBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      index_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.LazyStringList datapointIds_ =
        com.google.protobuf.LazyStringArrayList.EMPTY;

    private void ensureDatapointIdsIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        datapointIds_ = new com.google.protobuf.LazyStringArrayList(datapointIds_);
        bitField0_ |= 0x00000001;
      }
    }
    /**
     *
     *
     *

     * A list of datapoint ids to be deleted.
     *

     *
     * repeated string datapoint_ids = 2;
     *
     * @return A list containing the datapointIds.
     */
    public com.google.protobuf.ProtocolStringList getDatapointIdsList() {
      return datapointIds_.getUnmodifiableView();
    }
    /**
     *
     *
     *

     * A list of datapoint ids to be deleted.
     *

     *
     * repeated string datapoint_ids = 2;
     *
     * @return The count of datapointIds.
     */
    public int getDatapointIdsCount() {
      return datapointIds_.size();
    }
    /**
     *
     *
     *

     * A list of datapoint ids to be deleted.
     *

     *
     * repeated string datapoint_ids = 2;
     *
     * @param index The index of the element to return.
     * @return The datapointIds at the given index.
     */
    public java.lang.String getDatapointIds(int index) {
      return datapointIds_.get(index);
    }
    /**
     *
     *
     *

     * A list of datapoint ids to be deleted.
     *

     *
     * repeated string datapoint_ids = 2;
     *
     * @param index The index of the value to return.
     * @return The bytes of the datapointIds at the given index.
     */
    public com.google.protobuf.ByteString getDatapointIdsBytes(int index) {
      return datapointIds_.getByteString(index);
    }
    /**
     *
     *
     *

     * A list of datapoint ids to be deleted.
     *

     *
     * repeated string datapoint_ids = 2;
     *
     * @param index The index to set the value at.
     * @param value The datapointIds to set.
     * @return This builder for chaining.
     */
    public Builder setDatapointIds(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureDatapointIdsIsMutable();
      datapointIds_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * A list of datapoint ids to be deleted.
     *

     *
     * repeated string datapoint_ids = 2;
     *
     * @param value The datapointIds to add.
     * @return This builder for chaining.
     */
    public Builder addDatapointIds(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureDatapointIdsIsMutable();
      datapointIds_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * A list of datapoint ids to be deleted.
     *

     *
     * repeated string datapoint_ids = 2;
     *
     * @param values The datapointIds to add.
     * @return This builder for chaining.
     */
    public Builder addAllDatapointIds(java.lang.Iterable<java.lang.String> values) {
      ensureDatapointIdsIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, datapointIds_);
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * A list of datapoint ids to be deleted.
     *

     *
     * repeated string datapoint_ids = 2;
     *
     * @return This builder for chaining.
     */
    public Builder clearDatapointIds() {
      datapointIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * A list of datapoint ids to be deleted.
     *

     *
     * repeated string datapoint_ids = 2;
     *
     * @param value The bytes of the datapointIds to add.
     * @return This builder for chaining.
     */
    public Builder addDatapointIdsBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureDatapointIdsIsMutable();
      datapointIds_.add(value);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest)
  private static final com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest();
  }

  public static com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<RemoveDatapointsRequest> PARSER =
      new com.google.protobuf.AbstractParser<RemoveDatapointsRequest>() {
        @java.lang.Override
        public RemoveDatapointsRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

  public static com.google.protobuf.Parser<RemoveDatapointsRequest> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<RemoveDatapointsRequest> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}


text:
@interface MZProfileCell : UITableViewCell

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;

@end