class __attribute__()

in ComponentKit/LayoutComponents/BackgroundLayoutComponentBuilder.h [27:83]


class __attribute__((__may_alias__)) BackgroundLayoutComponentBuilder
    : public BuilderBase<BackgroundLayoutComponentBuilder, PropsBitmap> {
 public:
  BackgroundLayoutComponentBuilder() = default;

  ~BackgroundLayoutComponentBuilder() = default;

  /**
   A child that is laid out to determine the size of this component.
   */
  auto &component(NS_RELEASES_ARGUMENT CKComponent *c)
  {
    constexpr auto componentIsNotSet = !PropBitmap::isSet(PropsBitmap, BackgroundLayoutComponentPropId::component);
    static_assert(componentIsNotSet, "Property 'component' is already set.");
    _component = c;
    return reinterpret_cast<
      BackgroundLayoutComponentBuilder<PropsBitmap | BackgroundLayoutComponentPropId::component> &>(*this);
  }

  /**
   A child that is laid out behind the component. May be nil, in which case the background is omitted.
   */
  auto &background(NS_RELEASES_ARGUMENT CKComponent *c)
  {
    constexpr auto backgroundIsNotSet = !PropBitmap::isSet(PropsBitmap, BackgroundLayoutComponentPropId::background);
    static_assert(backgroundIsNotSet, "Property 'background' is already set.");
    _background = c;
    return reinterpret_cast<
      BackgroundLayoutComponentBuilder<PropsBitmap | BackgroundLayoutComponentPropId::background> &>(*this);
  }

 private:
  friend BuilderBase<BackgroundLayoutComponentBuilder, PropsBitmap>;

  /**
  Creates a new component instance with specified properties.

  @note  This method must @b not be called more than once on a given component builder instance.
  */
  NS_RETURNS_RETAINED auto _build() noexcept -> CKBackgroundLayoutComponent *
  {
    constexpr auto componentIsSet = PropBitmap::isSet(PropsBitmap, BackgroundLayoutComponentPropId::component);
    static_assert(componentIsSet, "Required property 'component' is not set.");
    constexpr auto backgroundIsSet = PropBitmap::isSet(PropsBitmap, BackgroundLayoutComponentPropId::background);
    static_assert(backgroundIsSet, "Required property 'background' is not set.");

    if (_component != nil) {
      return [[CKBackgroundLayoutComponent alloc] initWithComponent:_component background:_background];
    } else {
      return nil;
    }
  }

 private:
  CKComponent *_component;
  CKComponent *_background;
};