from typing import Tuple


def split_templated_class_name(class_name: str) -> Tuple:
    """
    Example:
        "OctreePointCloud<PointT, LeafContainerT, BranchContainerT>::Ptr"
        ("OctreePointCloud", (PointT, LeafContainerT, BranchContainerT), "::Ptr")
    """
    template_types = tuple()
    pos = class_name.find("<", 1)
    pos_end = class_name.rfind(">")
    is_templated = pos > 0
    end_pos_basename = pos if is_templated else None
    class_base_name = class_name[:end_pos_basename]
    after_template = class_name[pos_end + 1:] if is_templated else ""
    if is_templated:
        template_types = tuple([s.strip() for s in class_name[pos + 1:pos_end].split(",")])
    return class_base_name, template_types, after_template