Fabric: ConcreteViewShadowNode::BaseShadowNode type alias

Summary:
@public
Just a type alias to make the code prettier, nothing more.

Reviewed By: mdvacca

Differential Revision: D8988383

fbshipit-source-id: 3f21de0ec0cb9a2270eccfc4a67a3d1108535e42
This commit is contained in:
Valentin Shergin 2018-08-04 09:30:22 -07:00 коммит произвёл Facebook Github Bot
Родитель 95074e6c12
Коммит ca6d263d6d
1 изменённых файлов: 9 добавлений и 8 удалений

Просмотреть файл

@ -43,17 +43,18 @@ class ConcreteViewShadowNode:
static_assert(std::is_base_of<AccessibilityProps, ViewPropsT>::value, "ViewPropsT must be a descendant of AccessibilityProps"); static_assert(std::is_base_of<AccessibilityProps, ViewPropsT>::value, "ViewPropsT must be a descendant of AccessibilityProps");
public: public:
using BaseShadowNode = ConcreteShadowNode<
concreteComponentName,
ViewPropsT,
ViewEventEmitterT
>;
using ConcreteViewProps = ViewPropsT; using ConcreteViewProps = ViewPropsT;
using SharedConcreteViewProps = std::shared_ptr<const ViewPropsT>;
using ConcreteViewEventEmitter = ViewEventEmitterT;
using SharedConcreteViewEventEmitter = std::shared_ptr<const ViewEventEmitterT>;
using SharedConcreteViewShadowNode = std::shared_ptr<const ConcreteViewShadowNode>;
ConcreteViewShadowNode( ConcreteViewShadowNode(
const ShadowNodeFragment &fragment, const ShadowNodeFragment &fragment,
const ShadowNodeCloneFunction &cloneFunction const ShadowNodeCloneFunction &cloneFunction
): ):
ConcreteShadowNode<concreteComponentName, ViewPropsT, ViewEventEmitterT>( BaseShadowNode(
fragment, fragment,
cloneFunction cloneFunction
), ),
@ -63,14 +64,14 @@ public:
YogaLayoutableShadowNode() { YogaLayoutableShadowNode() {
YogaLayoutableShadowNode::setProps(*std::static_pointer_cast<const ConcreteViewProps>(fragment.props)); YogaLayoutableShadowNode::setProps(*std::static_pointer_cast<const ConcreteViewProps>(fragment.props));
YogaLayoutableShadowNode::setChildren(ConcreteShadowNode<concreteComponentName, ViewPropsT, ViewEventEmitterT>::template getChildrenSlice<YogaLayoutableShadowNode>()); YogaLayoutableShadowNode::setChildren(BaseShadowNode::template getChildrenSlice<YogaLayoutableShadowNode>());
}; };
ConcreteViewShadowNode( ConcreteViewShadowNode(
const SharedShadowNode &sourceShadowNode, const SharedShadowNode &sourceShadowNode,
const ShadowNodeFragment &fragment const ShadowNodeFragment &fragment
): ):
ConcreteShadowNode<concreteComponentName, ViewPropsT, ViewEventEmitterT>( BaseShadowNode(
sourceShadowNode, sourceShadowNode,
fragment fragment
), ),
@ -87,7 +88,7 @@ public:
} }
if (fragment.children) { if (fragment.children) {
YogaLayoutableShadowNode::setChildren(ConcreteShadowNode<concreteComponentName, ViewPropsT, ViewEventEmitterT>::template getChildrenSlice<YogaLayoutableShadowNode>()); YogaLayoutableShadowNode::setChildren(BaseShadowNode::template getChildrenSlice<YogaLayoutableShadowNode>());
} }
}; };